Computer Arithmetic
Which correctly describes +0 and −0 in IEEE 754 floating point?
- A−0 cannot be represented; zero is always +0
- B+0 and −0 compare unequal, so an if statement can tell them apart
- CBoth exist and compare equal, but division can tell them apart
Show answer and explanation
Answer: C. Both exist and compare equal, but division can tell them apart
Because the sign bit is independent, floating point has two zeros differing only in sign, +0 and −0. They compare equal, but some operations differ: 1 ÷ (+0) is +∞ while 1 ÷ (−0) is −∞. −0 appears, for example, when a tiny negative number underflows, preserving which side zero was approached from. Since they compare equal, ordinary comparisons cannot distinguish them; the sign bit must be examined.
- A. −0 can be represented.
- B. They compare equal, so ordinary comparisons cannot tell them apart.
- C. Correct. They compare equal, but operations such as division reveal the difference.