title: Integer part of logarithm
body: <p>Please, does anyone know how to compute the integer part of natural logarithm of an integer?</p>
  
  <p>Preferably using integer arithmetic only (akin to <a href="https://en.wikipedia.org/wiki/Integer_square_root#Algorithm_using_Newton&#39;s_method" rel="nofollow noreferrer">integer square root</a> method), without relying on floating-point <code>log</code> (i.e. not <code>Math.floor(Math.log(x))</code>.</p>
  
  <hr>
  
  <p>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.</p>