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 belopolsky, mark.dickinson, mcherm, rhettinger, stutzbach, tim.peters, vstinner
Date 2010-06-01.08:31:10
SpamBayes Score 0.0013394057
Marked as misclassified No
Message-id <1275381072.68.0.694530842599.issue8860@psf.upfronthosting.co.za>
In-reply-to
Content
An example where getting correct rounding is awkward: the following rounds up, with or without the patch:

>>> datetime.timedelta(seconds=0.6112295)
datetime.timedelta(0, 0, 611230)

But in this case, the result should actually be rounded down (with either rounding mode), since the exact value of float('0.6112295') is a little less than 0.6112295:

>>> print(Decimal(0.6112295))
0.61122949999999998116351207499974407255649566650390625

The problem is that leftover_us ends up being exactly 0.5 in this case.  Again, this could be worked around if we really care, but I'm not convinced it's worth it.
History
Date User Action Args
2010-06-01 08:31:13mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, mcherm, rhettinger, belopolsky, vstinner, stutzbach
2010-06-01 08:31:12mark.dickinsonsetmessageid: <1275381072.68.0.694530842599.issue8860@psf.upfronthosting.co.za>
2010-06-01 08:31:11mark.dickinsonlinkissue8860 messages
2010-06-01 08:31:10mark.dickinsoncreate