If I remember correctly this is what you are looking for:
log(1024)/log(2)
That is the n-based log of a number is the e based log of the number divided by the e-based log of n (sorry about the wording, if a mathematician reads this I am sure (S)He will feel the urge to kill me!)
LOG_n(x) = LOG(x) / LOG(n)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges