Ruby's Math module includes functions for a natural log (log to the base e) and the common log (log to the base 10). If you have to have a log to an arbitrary base, you have to write your own. Doing so is trivial.
I will probably explain the theory behind this another day.
Monday, January 25, 2010
Logarithm to any base in ruby
Subscribe to:
Post Comments (Atom)

1 comments:
You should get the fields medal for this.
Post a Comment