Closed as duplicate of#116226
Description
As in Python 3:
https://docs.python.org/3/library/math.html#math.isqrt
To the Rust stdlib it could be added a isqrt() function for all u*/i*/usize/isize, that returns the floor of the square root of the nonnegative integral value n, that is the greatest integer a such that a*a <= n.
This in Python shows that the usual trick to pass through f64 isn't precise enough for u128:
>>> from math import sqrt, isqrt
>>> N = (2 ** 128) - 1 # u128::MAX
>>> a = int(sqrt(N))
>>> a
18446744073709551616
>>> b = isqrt(N)
>>> b
18446744073709551615
>>> (a * a) <= N
False