[issue31978] make it simpler to round fractions

Mark Dickinson report at bugs.python.org
Wed Nov 8 11:37:53 EST 2017


Mark Dickinson <dickinsm at gmail.com> added the comment:

> I don't know whether there is a common enough need in third-party code.

Me neither. But one thing to look for would be people doing `round(a / b)`, which is almost certainly giving the wrong result in corner cases. OTOH, even those uses may well be in code that doesn't actually care about getting the wrong result in those corner cases, or that doesn't exercise the corner cases. (E.g., if both `a` and `b` are not-too-large integers, `round(a / b)` is still "safe" in that it will give the same result as if a non-lossy integer division is used.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31978>
_______________________________________


More information about the Python-bugs-list mailing list