0.1 in floating point
The sign, exponent and mantissa bits of 0.1, and the exact value it stores.
Stored value and bits
Examples
Note
0.1 has no exact binary form, so it is stored as the nearest double, a tiny bit above 0.1. It prints as 0.1 because that is the shortest decimal that rounds back to the same bits.
Other notable values
- 0.1 in floating point
- Why 0.1 + 0.2 is not 0.3
- Number.MAX_SAFE_INTEGER (2^53 - 1)
- 2^53 + 1 cannot be stored
- Number.EPSILON (machine epsilon)
- Number.MAX_VALUE, the largest double
- Number.MIN_VALUE, the smallest double
- Negative zero (-0) in floating point
- NaN (not a number) in floating point
- Infinity in floating point
- 16777217, the first integer a float cannot store
- 1/3 in floating point