On Feb 7, 2007, at 2:50 PM, Phrogz wrote:

> Ideally they'd be implemented in C, but of course the simple Ruby
> implementation is just:
>   def Math.log2( x ); Math.log( x ) / Math.log( 2 ); end
>   def Math.logn( x, n ); Math.log( x ) / Math.log( n ); end

I second the motion.

The log2 function is now in the C math library, so I think it would  
easy to add it the Ruby Math library. I would like see log for  
arbitrary base added too. But here I would suggest a slightly  
different name and argument order:

    def Math.logb(b, x); Math.log(x) / Math.log(b); end

This, I believe, would be more in accord with other programming  
languages that already offer this function.

Regards, Morton