GATE Computer ScienceHardGATE CS (PYQ pattern)

Which of the following are true in IEEE 754 arithmetic (using the language operators ==, != and the usual semantics)? Let nan be a NaN and let +0 and −0 be the two zeros. I. nan == nan II. nan != nan III. +0 == −0 IV. 1/(+0) == 1/(−0) V. nan < 1 or nan >= 1

  1. A. II and III only
  2. B. I, III and V only
  3. C. II, III and IV only
  4. D. II and V only

Correct answer: A. II and III only

Every comparison with NaN except != is false, so I and V are false and II is true. +0 and −0 compare equal (III), but 1/(+0) = +∞ and 1/(−0) = −∞, so IV is false.

More Digital Logic questions

Exams that ask this topic