0

What is the roundoff error when we represent $2^{-1} + 2^{-25}$ by a machine number? (Note: this refers to absolute error, not relative)

Please, help

John Lennon
  • 1,302

1 Answers1

2

Assuming a Single precision IEE754 number.

You have a sign bit: 0 is positive, 1 is negative

8 bits for the exponent with a -127 offset (range -127 to +128)

A 24 bit mantissa. The top bit is always assumed to be 1 so only 23 bits are stored.

For your example you need 25 bits of mantissa so $2^{-25}$ is too small to fit and the closest you can get is $2^{-1} = \frac{1}{2}$

The absolute error is therefore $2^{-25}$.

Note. With double precision numbers the absolute error would be zero.

Warren Hill
  • 3,092