C: Safe to Calculate Number of Digits in Integer (N) of Base (b) Using Logarithmic Functions
<p>Given the formula:</p>

<p><code>NUM_DIGITS_IN_N_FOR_BASE_B = 1 + floor(ln(abs(N)) / ln(b))</code></p>

<p>such that <code>b</code> is a base between 2 and 36 and <code>N</code> is of type int.</p>

<p>According to this post <a href="https://stackoverflow.com/questions/29847504/how-to-count-the-number-of-digits-in-numbers-in-different-bases">post 1</a> it seems okay to assume that the value returned for the range of all integers <code>[INT_MIN, INT_MAX]</code> would work with no round-off or overflow error. I am a bit skeptical about this. My skepticism comes from a recent post of mine @<a href="https://codereview.stackexchange.com/questions/120095/c-itoa-implementation/120363#120363">post 2</a>. If using the mathematical definition is not "safe" in a computer program, is there another trick to use to compute the number of digits in a number N given a base b?</p>