I just came across the need to calculate the digits of a number. It sounds trivial as we can see the digits & count them easily. Ho appena trovato la necessità di calcolare le cifre di un numero. Sembra banale come si può vedere le cifre & count facilmente.
The challenge is how to find them (with least effort) computationally? La sfida è come trovare loro (con meno sforzo) computazionalmente?

Solution: Soluzione:

1 + (int) (Math.log(i) / base10) 1 + (int) (Math.log (i) / Base10)

where base10 = Math.log(10) dove Base10 = Math.log (10)