From: "Eric I." Date: 2007-02-08T11:00:08+09:00 Subject: Re: Adding Math.log2 and Math.logn to the core library. On Feb 7, 7:08 pm, Morton Goldberg wrote: > Well, I can find examples with the base first or second. Perhaps for > Ruby it would most idiomatic to define log as follows > > def Math.log(x, b=Math::E); ... ; end > > as the core method with log10 and log2 handled (for performance) as > special cases within this method. Given that, I would still want Math > to implement log10 and log2 methods for convenience. Math.log calls the log in the standard math library, which I suspect implements the natural log calculation pretty efficiently. If you make the second parameter the base, you'll either have to check it against Math::E and treat it as a special case or do two log calculations for the natural log case. I don't like either of those options. Eric