Computer Arithmetic
Which correctly describes representing decimal 0.1 as a binary floating-point number?
- AIt can be represented exactly as 0.1 in binary too, so no error arises
- BIt becomes an infinitely repeating binary fraction, so a nearby rounded value is stored
- CIn binary, it becomes exactly ten times larger than the original value
Show answer and explanation
Answer: B. It becomes an infinitely repeating binary fraction, so a nearby rounded value is stored
Decimal 0.1 in binary is 0.000110011001100…, with 0011 repeating forever. A floating-point significand has limited digits, so only a nearby rounded value can be stored, introducing a small error. Any fraction whose denominator is not a power of two cannot be written in finitely many binary digits, whereas numbers such as 0.5 and 0.25 are exact. No conversion makes the value ten times larger.
- A. 0.1 cannot be written with finitely many binary digits.
- B. Correct. It becomes a repeating binary fraction, so a rounded value is stored.
- C. No conversion multiplies the value by ten.