NOTE:

These are a little sketchy...I'll fill in details 'soon'.

Logs, not just for cabins anymore!

A little known formula from information theory states that the number of digits required to represent a number N in a base B is:

    | log  N |
    |    B   |  + 1
    --      --

(Recall that ¦_x represents the floor of -- or greatest integer less than or equal to -- x.

Therefore it takes 1 digit to represent the value 2 in base 10:

    | log   2 |
    |    10   |  + 1  =  | 0.30103 | + 1  =  0 + 1  =  1
    --       --          --       --

And it takes 4 digits to represent 10 in base 2 (1010):

    | log  10 |
    |    2    |  + 1  =  | 3.32193 | + 1  =  3 + 1  =  4
    --       --          --       --

The memory of a log...

Remember, btw, that to find logs in alternative bases, simply divide the log you have by the log of the new base in the log you have:

                log  N
                   10
    log  N  =  --------
       B        log  B
                   10

So the log to the base 2 of 10 is:

                log  10
                   10            1
    log  10  = ---------  ≅  ---------  ≅  3.32193
       2        log  2        0.30103
                   10

(Also recall that log to the base 10 -- the common logarithm -- is log10() from the math library.)