Practice question · Numerical answer
In that same toy system, representable values are spaced 0.25 apart. What is the largest possible round-off error when a real number in that range is stored?
Hints
- The worst case is a real number sitting as far as possible from both neighbours.
- That happens exactly halfway between two representable values.
Show the answer
0.125 (answers within ±0.001 count)
Why
A value midway between two ticks is 0.125 from each, so the worst-case error is half the spacing. This is why round-off error is described as half the gap between neighbouring floats, and why it grows with the magnitude of the number.
Practise Floating-Point Numbers
The app has 6 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.
More questions on Floating-Point Numbers
- Sort each way of comparing two floating-point values.
- In 1996 the Ariane 5 rocket destroyed itself 37 seconds after launch, from converting a 64-bit float to a…
- Select every statement about floating-point arithmetic that is TRUE.
- Floating-point numbers are spaced evenly in a toy system like 1.0, 1.25, 1.5, 1.75, 2.0 - but across the full…