Rounding error in Python 2.0

John W. Baxter jwbnews at scandaroon.com
Wed Dec 6 00:13:46 EST 2000


In article <AnjX5.2006$O%.346064 at newsc.telia.net>, "Fredrik Lundh" 
<fredrik at effbot.org> wrote:

>     A. Binary floating point cannot represent decimal fractions
>     exactly, so some rounding always occurs (even in Python
>     1.5.2).

Well, 20% of the numbers with a single digit to the right of the 
decimal, and 4% of the numbers with two digits to the right of the 
decimal (and so on) are precise.  It's only the other 80% or 96% or... 
which aren't.  ;-)  --John

-- 
John W. Baxter   Port Ludlow, WA USA  jwbnews at scandaroon.com



More information about the Python-list mailing list