C++ 學習筆記(2) —— float 和 double 的精度,floatdouble
Size | Range | Precision |
4 bytes
±1.18 x 10
-38 to ±3.4 x 10
38
6-9 significant digits, typically 7
8 bytes
±2.23 x 10
-308 to ±1.80 x 10
308
15-18 significant digits, typically 16
80-bits (12 bytes)
±3.65 x 10
-4951 to ±1.18 x 10
4932
18-21 significant digits
16 bytes
±3.36 x 10
-4932 to ±1.18 x 10
4932
33-36 significant digits