[Python-Dev] Expert floats

Andrew Koenig ark-mlist at att.net
Tue Mar 30 15:12:29 EST 2004


> But you can't get away from that via any decimal rounding rule.  One of
> the *objections* the 754 committee had to the Scheme rule is that moving
> rounded shortest-possible decimal output to a platform with greater
> precision could cause the latter platform to read in an unnecessarily poor
> approximation to the actual number written on the source platform.  It's
> simply a fact that decimal 1.1000000000000001 is a closer approximation to
> the number stored in an IEEE double (given input "1.1" perfectly rounded
> to IEEE double format) than decimal 1.1, and that has consequences too
> when moving to a wider precision.

But if you're moving to a wider precision, surely there is an even better
decimal approximation to the IEEE-rounded "1.1" than 1.1000000000000001
(with even more digits), so isn't the preceding paragraph a justification
for using that approximation instead?






More information about the Python-Dev mailing list