Retro <vinet...@gmail.com> added the comment:

Gee, thanks for the insight. I didn't thought about the fact that binary 
floating point is so imprecise and can cause the round() to "error" in some 
situations.

In this case, the representation and the actual value are (way) off. How can 
that be? There are just 3 decimal numbers (.255) and Python at parsing the 
float is already off at the third decimal number. I'll never trust round() 
again. Well, actually I trust round() to do its job well -- it's the binary 
floating point I'm affraid of!

We must implement the decimal API to the core of Python in order to have 
precision.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10101>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to