Computer Arithmetic

What is the machine epsilon (the gap between 1 and the next larger representable number) in IEEE 754 single precision?

  1. A2⁻²³ (about 1.19 × 10⁻⁷)
  2. B2⁻⁸ (about 3.9 × 10⁻³)
  3. C2⁻⁵² (about 2.2 × 10⁻¹⁶)
Show answer and explanation

Answer: A. 2⁻²³ (about 1.19 × 10⁻⁷)

1.0 is represented as 1.000…0 × 2⁰ with a 23-bit significand, so incrementing the last significand bit gives 1 + 2⁻²³. That gap, 2⁻²³ ≈ 1.19 × 10⁻⁷, is machine epsilon, indicating single precision's relative precision of about seven digits. 2⁻⁵² is the machine epsilon of double precision with its 52-bit significand. 2⁻⁸ confuses it with the exponent width. The value also guides tolerances for comparing floating-point numbers.

  • A. Correct. With a 23-bit significand it is 2⁻²³.
  • B. 2⁻⁸ confuses it with the 8-bit exponent.
  • C. 2⁻⁵² is double precision's machine epsilon.
Practice this topic Back to topic

More Computer Arithmetic questions

  1. Which gives the approximate number of reliable decimal digits for single and double precision?
  2. What is the role of IEEE 754 subnormal numbers?
  3. On some processors, computations involving many subnormal numbers can slow down dramatically. Which setting is used when performance takes priority?
  4. Under IEEE 754, what result does the standard specify for dividing a positive number by zero?
  5. When x is NaN, what does evaluating x == x give in most programming languages?