Mega Code Archive

 
Categories / Ruby / Development
 

Do natural logarithms (base E or Euler) and base-10 logarithms

Math.log(Math::E) # => 1.0 Math.log(1) # => 0.0 Math.log(0) # => -Infinity Math.log10(100.0) # => 2.0