> try running this in python:
>
> print [39.95]
>
> the output i get is:
> [39.950000000000003]
>
> what's up with that?

That's perfectly normal - some numbers aren't exactly expressible as
binary floating points, just like 1/3 isn't expressible as a decimal
floating point number.

Here's a good link on floating point arithmetic:
http://docs.sun.com/source/806-3568/ncg_goldberg.html

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to