George Boutsioukis <[EMAIL PROTECTED]> added the comment:

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.

----------
keywords: +patch
nosy: +gboutsioukis
Added file: http://bugs.python.org/file10944/round_patch.diff

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1869>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to