Floating point problem

Richard Damon Richard at Damon-Family.org
Tue Apr 21 10:30:39 EDT 2020


On 4/21/20 9:43 AM, Chris Angelico wrote:
> Right. Now try diagnosing weird bugs in floating-point calculations,
> and you aren't sure if it's because sometimes you have 53 bits of
> mantissa and sometimes only 52.
>
And sometimes only 1. The smallest positive floating point number has
only 1 significant digit (leading 0's are NOT significant), so the
second smallest floating point number is twice that number. The key is
that once you hit the denormals, you no longer have a relative accuracy
like in the normal numbers, but all the denormals have the same absolute
accuracy.

-- 
Richard Damon



More information about the Python-list mailing list