Bad Math
Robert Kern
rkern at ucsd.edu
Sat Jul 2 00:03:30 EDT 2005
Patrick Rutkowski wrote:
> I started reading a python book today, one example was:
>
>>>>4 / (2.0 + 3)
>
> 0.8
Must be an old book.
> My input/output was:
>
>>>>4 (2.0 + 3)
>
> 0.80000000000000004
This is correct.
> Something smells fishy here... whats up?
>
> --python 2.4.1
http://docs.python.org/tut/node16.html
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the Python-list
mailing list