From: "M. Edward (Ed) Borasky" Date: 2006-05-07T03:39:33+09:00 Subject: Re: What do you say to log2 to Math module? Am I missing something here? In any programming language, define the constant Multiplier = 1.0/logtoanybase(2) Then log2(x) = Multiplier*logtoanybase(x) You have to compute the Multiplier *once*. My guess is that most implementations of other languages compute logs to only one base, probably the natural (base e) log, and compute logs to all other bases by doing this multiplication every time you call them -- or worse, not pre-computing the Multiplier and doing a divide every time, which takes longer and is less accurate. Minkoo Seo wrote: > Hi list. > > I'm using ruby for my research purpose, and as everyone knows > computer science is all about log function whose base is 2. > > Unfortunately, Math module does not contain log2 though it has > log10. What do you think about adding log2 to Math? > > Yes, I know that adding log2 is way so simple because I can > open Math module and add log2 method, but I've had to that ALWAYS. > > Sincerely, > Minkoo Seo > -- M. Edward (Ed) Borasky http://linuxcapacityplanning.com