Thanks codemastr, that's actually quite handy.
As for the rounding issue, one can simply $round($calc($log($1)/$log($2)),5) or even less decimal places as desired.
However, it would be nice if Khaled added this function internally, as it does pose a problem when working with even moderately large numbers.