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 Larry
Recipients Larry
Date 2014-08-04.17:29:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407173397.31.0.0273570683592.issue22134@psf.upfronthosting.co.za>
In-reply-to
Content
Certain values close to the rounding boundary are rounded down instead of up; and this is done somewhat inconsistently.


#Example (python v2.7.8, and previous)

#almost an odd-even pattern, but not quite
for x in [1.045, 1.145, 1.245, 1.345, 1.445, 1.545, 1.645, 1.745, 1.845, 1.945]:
    print "{0:.3f} => {0:.2f}".format(x)

#while ..6 rounds up correctly
for x in [1.046, 1.146, 1.246, 1.346, 1.446, 1.546, 1.646, 1.746, 1.846, 1.946]:
    print "{0:.3f} => {0:.2f}".format(x)
History
Date User Action Args
2014-08-04 17:29:57Larrysetrecipients: + Larry
2014-08-04 17:29:57Larrysetmessageid: <1407173397.31.0.0273570683592.issue22134@psf.upfronthosting.co.za>
2014-08-04 17:29:57Larrylinkissue22134 messages
2014-08-04 17:29:57Larrycreate