The imprecision of double precision floating point: a demonstration

Alonso Del Arte
4 min readMar 2, 2024
Photo by Lucas Kepner on Unsplash

Many beginning programmers, and even a lot of professional programmers, don’t understand that the floating point number format is inherently imprecise. Any number can be represented in floating point if we are willing to allow infinite variance.

In other words, the result of a floating point calculation can be wrong by a factor of infinity. The…

--

--

Alonso Del Arte

is a Java and Scala developer from Detroit, Michigan. AWS Cloud Practitioner Foundational certified