GATE Computer ScienceVery hardGATE CS (PYQ pattern)

In IEEE 754 single precision with round-to-nearest, ties-to-even, what is the smallest positive single-precision number x for which the computed 1.0f + x is greater than 1.0f?

  1. A. 2⁻²³
  2. B. 2⁻²⁴
  3. C. 2⁻²⁴ + 2⁻⁴⁷
  4. D. 2⁻²⁴ + 2⁻⁴⁸

Correct answer: C. 2⁻²⁴ + 2⁻⁴⁷

Just above 1 the spacing is 2⁻²³, so 1 + x rounds up only if x exceeds half an ulp, 2⁻²⁴. x = 2⁻²⁴ is an exact tie and rounds to the even neighbour 1.0. The next float above 2⁻²⁴ is 2⁻²⁴(1 + 2⁻²³) = 2⁻²⁴ + 2⁻⁴⁷, which rounds up. 2⁻²⁴ + 2⁻⁴⁸ would need 25 significant bits, so it is not a single-precision number; 2⁻²³ is machine epsilon, not the smallest such x.

More Digital Logic questions

Exams that ask this topic