[issue5473] round(float, ndigits<0) sometimes rounds to odd
report at bugs.python.org
Wed Mar 11 11:05:17 CET 2009
Mark Dickinson <dickinsm at gmail.com> added the comment:
> (in this case a division by 10.0)
Of course, that's not true: division by 10.0 is harmless when the
result is exactly representable. It's actually a multiplication by
pow(10.0, -1), which is worse...
I'm currently working on incorporating David Gay's code for string <->
float conversions into Python. If these go in, then it would be
straightforward to implement a fast, correctly-rounded round for floats
based on a combination of Gay's strtod and dtoa functions.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list