R. David Murray <[email protected]> added the comment:
Please read
http://docs.python.org/tutorial/floatingpoint.html
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.
----------
nosy: +r.david.murray
resolution: -> invalid
stage: -> committed/rejected
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9885>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com