R. David Murray added the comment:
Read this:
http://docs.python.org/tutorial/floatingpoint.html?highlight=rounding
And then perhaps take a look at the Decimal package.
--
nosy: +r.david.murray
priority: -> low
resolution: -> invalid
stage: -> committed/rejected
status: open -> clo
New submission from James Sparenberg :
Python produces rounding errors when adding decimals.
ython 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 13.04 + 158.00
171.03
>>> 13 +158
171
>>> 13.0