Proof: How many digits does a number have? $\lfloor \log_{10} n \rfloor +1$ I read recently that you can find the number of digits in a number through the formula $\lfloor \log_{10} n \rfloor +1$ What's the logic behind this rather what's the proof?
Suppose that $n$ has $d$ digits; then $10^{d-1}\le n&lt;10^d$, because $10^d$ is the smallest integer with $d+1$ digits. Now take logs base $10$: $\log_{10}10^k=k$, so the inequality becomes $d-1\le\log_{10}n&lt;d$. If you now take the floor (= integer part) of $\log_{10}n$, throwing away everything to the right of the decimal point, you get $\lfloor\log_{10}n\rfloor=d-1$. Thus, $d=\lfloor\log_{10}n\rfloor+1$. This isn’t quite what you posted, but it’s the integer part of it, and clearly the number of digits must be an integer.
The number of decimal digits in $N$ would be $⌊\log_{10}N⌋+1$
Just remember that $⌊\log_{10}N⌋$ should always be in decimal form.