Questions: Floating-Point Representation (IEEE 754)

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A programmer writes `if (0.1 + 0.2 == 0.3)` in a language using IEEE 754, and the condition evaluates to false. The most accurate explanation is:

AThe processor has a bug in its floating-point arithmetic unit that affects certain decimal fractions
B0.1, 0.2, and 0.3 cannot be represented exactly in binary, so 0.1 + 0.2 produces a slightly different approximation than the stored value of 0.3
CFloating-point addition is not commutative, so the result depends on operand order
DThe equality operator is inherently unreliable for all numeric comparisons in IEEE 754
Question 2 Multiple Choice

In IEEE 754 single-precision format, the exponent field stores the value 130. What actual exponent does this represent?

A130 — the stored value is used directly as the exponent
B3 — the actual exponent is the stored value minus the bias of 127
C2 — the stored exponent uses two's complement, so 130 encodes 2
D257 — the bias is added to the stored value to get the actual exponent
Question 3 True / False

In IEEE 754 single-precision, the leading 1 of the significand is implicit and not stored, giving 24 bits of effective precision from only 23 stored mantissa bits.

TTrue
FFalse
Question 4 True / False

Floating-point rounding errors indicate a poorly designed processor and can be eliminated by using more careful arithmetic circuit design.

TTrue
FFalse
Question 5 Short Answer

Explain why adding a very small floating-point number to a very large one might produce no change at all, using the concept of how representable values are spaced.

Think about your answer, then reveal below.