Square root of natural numbers
An efficient binary implementation of a (sqrt n
) function that
returns s
such that
s*s ≤ n ≤ s*s + s + s
Auxiliary function for nat.sqrt
. See e.g.
https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Binary_numeral_system_(base_2)