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 mark.dickinson
Recipients mark.dickinson
Date 2009-10-06.08:38:43
SpamBayes Score 0.00088553136
Marked as misclassified No
Message-id <1254818325.66.0.811291436482.issue7070@psf.upfronthosting.co.za>
In-reply-to
Content
The single-argument form of the builtin round function can give
incorrect results for large integers.

>>> x = 5e15+1
>>> x == int(x)
True
>>> x == round(x)  # expect True here
False
>>> x
5000000000000001.0
>>> round(x)
5000000000000002.0
>>> int(x)
5000000000000001

This is already fixed in trunk (and in 3.x);  the fix needs to be
backported to release26-maint.
History
Date User Action Args
2009-10-06 08:38:45mark.dickinsonsetrecipients: + mark.dickinson
2009-10-06 08:38:45mark.dickinsonsetmessageid: <1254818325.66.0.811291436482.issue7070@psf.upfronthosting.co.za>
2009-10-06 08:38:44mark.dickinsonlinkissue7070 messages
2009-10-06 08:38:43mark.dickinsoncreate