Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Waiting for someone to post some fast-inverse-sqrt-esque hack to compute the logarithm. Although in Java that's probably not likely to be faster.

I wonder how fast it'd be to convert to string and count digits.



> I wonder how fast it'd be to convert to string and count digits.

When you convert the number to a string you're really transforming it to a decimal format. Which is the domain where you should be solving the problem. Otherwise you're doing some sort transformation in the binary domain and then hopping to pull the answer out of a hat when you do the final convertion to decimal.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: