Please, does anyone know of a algorithm to compute the integer part $n$ of natural logarithm of an integer $x$?
$$n = \lfloor \ln(x) \rfloor$$
Preferably using integer arithmetic only (akin to integer square root method), without relying on floating-point $\log(x)$ function, as the argument could be quite large (typically many thousands of bits; maybe less than millions, definitely more than 64).
PS: I also would like to compute the integer part of square of the natural logarithm, i.e.:
$$n = \lfloor \ln^2(x) \rfloor$$
Would it be possible to adapt the above algorithm to compute this as well?