-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Minkoo Seo wrote: > 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? A few weeks ago, someone in the #ruby-lang channel on irc.freenode.net showed me an easy way of doing log2 in Ruby: integer.to_s(2).length irb(main):011:0> 3.to_s(2) => "11" irb(main):012:0> 3.to_s(2).length => 2 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEWsa/mV9O7RYnKMcRAhFrAJ9OIW1Dm61kAOBePYFYSoSLjwSQWACgoXrS +1VQeu8l5EhS7dA17sLI/ks= =f/Uy -----END PGP SIGNATURE-----