[issue46187] Optionally support rounding for math.isqrt()

Raymond Hettinger report at bugs.python.org
Wed Dec 29 03:14:55 EST 2021


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> So use decimal's ROUND_CEILING, ROUND_FLOOR, and ROUND_HALF_EVEN

It think is would suck to have to type those out.  Sorry, I think you're headed down the path of foolish consistency with an unrelated module and a more complicated topic.  What's wrong with keeping consistent the name of the existing functions: round, floor, and ceil which are self-explanatory and much better known than the decimal module constants.  Also, the intent for these to be substitutable for existing code which uses round(sqrt(x)), floor(sqrt(x)), and ceil(sqrt(x)).  If those are the starting point, then round, floor, and ceil are a logical progression from the existing code.  It is also consistent with how the numeric tower approaches various ways of rounding.

----------

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


More information about the Python-bugs-list mailing list