▸0.625 in decimal = 0.101 in binary
- The decimal 0.625 has an exact binary representation. This only happens when the denominator of the fraction (when fully reduced) has 2 as its only prime factor (e.g. 1/2, 1/4, 1/8).
- The fractional part required 3 bits. In a 32-bit IEEE 754 float, 23 bits are available for the significand fraction.
- Understanding binary fractions is essential for computer science: floating-point arithmetic, fixed-point DSP, and data serialization all rely on this conversion.
Next stepTry entering 0.1, 0.2, and 0.3 to see why they produce repeating binary fractions, and why 0.1 + 0.2 does not equal exactly 0.3 in floating-point arithmetic.