[Pythonmac-SIG] possible bug with division operator and
floating point numbers
Richard Gordon
richard@richardgordon.net
Wed, 17 Jan 2001 00:01:06 -0500
> it basically worked out to 4.0/5.0 .
>which came back with the answer, "0.80000000000000004." Now I have been
>out of school for a bit, but Ilearned that should be 0.8.
Maybe this has been covered here & I missed it, but you are certainly
correct and it's certainly strange. The same thing happens on NT, so
it's not a Mac thing and doing 4.0/5.0 yielded .8 on Debian Linux
running Python 1.5.2, so my conclusion is that something is broken in
Python 2. Altho the practical consequences of an error that small
don't seem like much to me, I'm not doing astronomy calculations or
other things where it might matter and it suggests that some other
stuff needs to be examined as well.
Richard Gordon
--------------------
Gordon Design
Web Design/Database Development
http://www.richardgordon.net