Bad Math
Brian van den Broek
bvande at po-box.mcgill.ca
Sat Jul 2 00:03:47 EDT 2005
Patrick Rutkowski said unto the world upon 01/07/2005 23:56:
> I started reading a python book today, one example was:
>
>
>>>>4 / (2.0 + 3)
>
> 0.8
>
> My input/output was:
>
>
>>>>4 (2.0 + 3)
>
> 0.80000000000000004
>
> Something smells fishy here... whats up?
>
> --python 2.4.1
<http://www.python.org/doc/faq/general.html#why-are-floating-point-calculations-so-inaccurate>
More information about the Python-list
mailing list