Computer Arithmetic
In single precision, adding 1 to 100 million (10⁸) leaves the result unchanged at 100 million. Which explains this?
- A100 million cannot be represented in single precision, so the result is NaN
- BWith only about seven digits, the 1 is lost in rounding
- CThe add instruction is designed to skip computations on large numbers
Show answer and explanation
Answer: B. With only about seven digits, the 1 is lost in rounding
Single precision has about seven significant digits, and near 100 million the spacing between representable numbers is 8. 100,000,001 falls between two representable values and rounds to the nearest, 100 million, so the 1 vanishes. Losing the smaller operand's information when adding numbers of different magnitudes is called absorption. When summing many small values, adding the smallest first or using compensated summation helps. 100 million is representable and does not become NaN.
- A. 100 million is representable and does not become NaN.
- B. Correct. The spacing near 10⁸ is 8, so 1 is rounded away.
- C. The add instruction does not skip any computation.