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 gboutsioukis
Recipients gboutsioukis, mark.dickinson
Date 2008-07-19.02:35:24
SpamBayes Score 0.00030052898
Marked as misclassified No
Message-id <1216434926.71.0.544799308946.issue1869@psf.upfronthosting.co.za>
In-reply-to
Content
The issue is that the implementation of round includes multiplying the
number by 10**ndigits, thus unnecessarily losing some precision for
large numbers within the IEEE754 double limits. This means that even
smaller numbers can produce these results for higher ndigit values, eg.

>>> round(56294995342131.5, 3) #one less digit
56294995342131.508

In the submitted patch I used modf to split the number and keep the
integral intact.
History
Date User Action Args
2008-07-19 02:35:26gboutsioukissetspambayes_score: 0.000300529 -> 0.00030052898
recipients: + gboutsioukis, mark.dickinson
2008-07-19 02:35:26gboutsioukissetspambayes_score: 0.000300529 -> 0.000300529
messageid: <1216434926.71.0.544799308946.issue1869@psf.upfronthosting.co.za>
2008-07-19 02:35:25gboutsioukislinkissue1869 messages
2008-07-19 02:35:25gboutsioukiscreate