Mark Dickinson <dicki...@gmail.com> added the comment: > Is your guess for round(25.0, > -1)==30.0 that 25.0*(1/10.0) is slightly more than 2.5 on some > systems?
Yes, something like that. I don't think it's feasible to make round perfectly correct (for floats) in all cases without implementing some amount of multiple precision code. But I think we can and should rewrite the code in such a way that it has a pretty good chance of returning correct results in common cases. Small powers of 10 can be computed exactly (up to 10**22, I think), in contrast to reciprocals of powers of 10. I'll work up a patch for round(int, int) -> int, so that at least we have the option of fixing this for 3.0.1 *if* there's general agreement that that's the right way to go. Seems like a python-dev discussion might be necessary to determine that. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4707> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com