/* Calculate log2(N) The log base N of any number, v, can be calulated by log(v)/log(N) where the function log can have any base */ proc float log2( float $variable ) { return (log ($variable))/(log (2)); }