Please, does anyone know how to compute the integer part of natural logarithm of an integer?
Preferably using integer arithmetic only (akin to integer square root method), without relying on floating-point log
(i.e. not Math.floor(Math.log(x))
.
To explain why this question is not duplicate of the linked question: this deals with natural logarithm and possibly unbounded inputs, the other is for base 2 or 10 and simulates floating-point by 32-bit fixed-precision arithmetic. The other question also does not explain how many fixed bits it requires to correctly compute integer part of natural log of unbounded input.