Question 65

Computer Awareness Number representations Medium

Which of the following statement is true about IEEE754 representation of +0 and -0?

(A) have the same sign bit, but different mantissa bits.
(B) differ only in the sign bit; their exponent and mantissa bits are identical.
(C) have the same representation because they are mathematically equivalent.
(D) differ in both their exponent and mantissa bits.
View Dynamic Solution & Explanation
Correct Solution: Option B

Step-by-step Solution:

Question

Which of the following statement is true about IEEE-754 representation of +0 and -0?

Answer

(B) differ only in the sign bit; their exponent and mantissa bits are identical.

Explanation

  1. In IEEE-754 floating point (both single and double precision) zero is encoded with all exponent bits = 0 and all fraction (mantissa) bits = 0. The only bit that can differ is the sign bit:
    • +0 : sign = 0, exponent = 0…0, fraction = 0…0
    • -0 : sign = 1, exponent = 0…0, fraction = 0…0
    e.g. in 32-bit single precision (hex): +0 = 0x00000000, -0 = 0x80000000.
  2. Although they have different bit patterns, most numerical comparisons treat them as equal: \[ +0 == -0 \quad\text{is true (per IEEE-754 equality).} \] However some operations are sensitive to the sign:
    • \(1/(+0) = +\infty\)
    • \(1/(-0) = -\infty\)
    So the sign bit can affect the result of certain signed operations (notably division and some functions that inspect the sign).
  3. Therefore statements that claim they differ in exponent or mantissa, or that they have identical representations, are incorrect. The precise correct statement is that they differ only in the sign bit.

Note: This signed-zero feature is intentional — it preserves directional information (sign) even at zero and makes certain limits and functions behave consistently in numerical computing.