[issue36887] Add integer square root, math.isqrt

Tim Peters report at bugs.python.org
Mon May 13 22:37:14 EDT 2019


Tim Peters <tim at python.org> added the comment:

+1 from me!  I'm tired of re-inventing this too :-)

Agree with every point Mark made.

Just in passing, noting a triviality:  for the ceiling, `1 + isqrt(n - 1)` fails when `n` is zero.

But I've never had a use for the ceiling here, or for "nearest" - just the floor.  Also for `iroot(n, k)` for k'th root floors with k > 2, but that too can wait.

----------
nosy: +tim.peters

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


More information about the Python-bugs-list mailing list