This math scares me

Tim Peters tim.one at home.com
Tue Mar 13 05:15:24 EST 2001


[Werner Schiendl]
> I wonder why 17 digits are used to represent the numbers...
> Think I can remember the precision of double was 15 to 16 decimal digits
> (depends on the value)
>
> Did I miss something?

It's so eval(repr(x))==x on 754-conforming platforms.  Try printing random
754 doubles under %.16g instead, then read them back in, then count how many
times you don't get back the number you printed.  You may be surprised!





More information about the Python-list mailing list