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

Anyone know how to denote 'log base 2'? This: "log (x)" assumes base 10.


For any base use the formula: (log base b) a = log(a)/log(b). For eg. google for log(x)/log(2), lg(x), log(x)/log(3)


I believe it's just "lg(x)", though you could also use the more generic case of "log(x)/log(base)"


Try lg(x) ?


that's it, thanks


lg(x) works for me.


thanks!


ln? Isn't log base 2 the natural log?

Yup, that works.



Oh yes, ok. Ignore my post. I forgot for a second that there was more than 2 numbers in the Universe.




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

Search: