[issue9885] Function Round does not work properly in some conditions
R. David Murray
report at bugs.python.org
Fri Sep 17 16:28:00 CEST 2010
R. David Murray <rdmurray at bitdance.com> added the comment:
Although your case isn't directly covered there, the root cause is the same. Floating point can't exactly represent 10.3.
Note that in Python2.7 and 3.x, the repr will be shortened to 10.3, so if you'd tried this there you would never have noticed the underlying issue.
If you need exact decimal arithmetic, use the Decimal module.
resolution: -> invalid
stage: -> committed/rejected
status: open -> closed
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list