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.私はただ全体の必要性を計算するには、数桁の数字です。 trivialとして聞こえること&数桁の数字を参照してそれらを簡単にします。
The challenge is how to find them (with least effort) computationally?への挑戦は、それらを検索する方法(最小努力の)計算ですか?

Solution:解決策:

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

where base10 = Math.log(10)どこbase10 = math.log ( 10 )