GATE Computer ScienceVery hardGATE CS (PYQ pattern)

In IEEE 754 single precision with round-to-nearest-even, let x = 2²³ = 8,388,608. What are the results of (x + 0.5) + 0.5 and x + (0.5 + 0.5), in that order?

  1. A. 8388608 and 8388609
  2. B. 8388608 and 8388608
  3. C. 8388609 and 8388609
  4. D. 8388609 and 8388608

Correct answer: A. 8388608 and 8388609

At 2²³ the spacing between floats is 1, so x + 0.5 is a tie and rounds to the even neighbour x; the second +0.5 does the same, giving 8388608. But 0.5 + 0.5 = 1 is exact, and x + 1 = 8388609.

More Computer Organization and Architecture questions

Exams that ask this topic