Floating-Point Spacing Changes with Magnitude

A binary floating-point format has bounded significant precision. The distance between representable numbers changes across exponent ranges.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace binary64 integers
  2. Check an increment at another scale
  3. Read spacing around a binary power boundary
  4. Choose a reference suitable for the operation

Trace binary64 integers

Near \(2^{53}\), consecutive representable values above it are separated by two. The mathematical value \(2^{53}+1\) lies between them. Binary rounding explains why computation chooses an available representation.

Check an increment at another scale

Adding one to a small integer is exactly representable in this format. Adding one to a very large counter may round back to the existing value. See floating-point spacing and rounding.[1][2]

Read spacing around a binary power boundary

In normal binary64 arithmetic, adjacent representable values immediately above one differ by \(2^{-52}\). Immediately below one the spacing is \(2^{-53}\) because the exponent interval is smaller. The relative scale is roughly comparable, while absolute distances change. See binary fraction rounding.

Around 1
Previous representable value: 1 − 2^-53
Current value: 1
Next representable value: 1 + 2^-52

Choose a reference suitable for the operation

A fixed decimal tolerance may become too tight at large magnitudes. Use a scale-aware criterion with explicit near-zero handling and check boundary powers. Inspect the documented rounding model for the environment.

References

  1. Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation ↩
  2. Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms ↩