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 brett.cannon
Recipients Laurent.Fournier, brett.cannon
Date 2013-08-01.12:48:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375361331.99.0.801693019965.issue18613@psf.upfronthosting.co.za>
In-reply-to
Content
This is actually expected because that is just how floating point works in programming (see http://en.wikipedia.org/wiki/Floating_point for all the gnarly details).

If you want exact decimal arithmetic, use the decimal module (which got significantly faster in Python 3.3)::

>>> import decimal
>>> decimal.Decimal('.3') - decimal.Decimal('.1')
Decimal('0.2')
>>> decimal.Decimal('.05') + decimal.Decimal('.01')
Decimal('0.06')
History
Date User Action Args
2013-08-01 12:48:52brett.cannonsetrecipients: + brett.cannon, Laurent.Fournier
2013-08-01 12:48:51brett.cannonsetmessageid: <1375361331.99.0.801693019965.issue18613@psf.upfronthosting.co.za>
2013-08-01 12:48:51brett.cannonlinkissue18613 messages
2013-08-01 12:48:51brett.cannoncreate