This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Retro
Recipients Retro, skip.montanaro
Date 2010-10-14.15:18:41
SpamBayes Score 2.0136736e-07
Marked as misclassified No
Message-id <1287069523.11.0.708456115914.issue10101@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-10-14 15:18:43Retrosetrecipients: + Retro, skip.montanaro
2010-10-14 15:18:43Retrosetmessageid: <1287069523.11.0.708456115914.issue10101@psf.upfronthosting.co.za>
2010-10-14 15:18:41Retrolinkissue10101 messages
2010-10-14 15:18:41Retrocreate