Comment by comicjk
4 years ago
When I'm explaining logarithms, I find it helps to relate it to the number of digits. This code is a good example of the concept: you don't need log, just convert the int to a string and check its length. A string with 1-3 digits is bytes, 4-6 is kb, etc.
No comments yet
Contribute on Hacker News ↗