[issue1869] Builtin round function is sometimes inaccurate for floats

George Boutsioukis report at bugs.python.org
Sun Aug 17 20:05:21 CEST 2008


George Boutsioukis <gboutsioukis at gmail.com> added the comment:

Hi Mark,

Yes, I see where you are going with this and I agree. I think the py3k
round function is a bit more accurate, any chance this can be backported
to 2.7(after modifying the half-rounding)?

Anyway, I was just playing around with the code when I wrote this patch.
Anything beyond math.h(and only the really portable functions) is
obviously out of the question, so there's little here to work with. 

Despite the (rare) unpredictable results, I think this issue is probably
too minor to spend any more time on;IMO nobody really relies on round()
for accuracy anyway. Perhaps this should be just ignored.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1869>
_______________________________________


More information about the Python-bugs-list mailing list