Module: Math

Defined in:
lib/sixarm_ruby_ramp/math.rb

Overview

Math extensions

Class Method Summary collapse

Class Method Details

.ln(num) ⇒ Float

Returns the natural log of num.

Examples:

Math.ln(2.719)
=> 1.00

Returns:

  • (Float)

    the natural log of num



14
15
16
# File 'lib/sixarm_ruby_ramp/math.rb', line 14

def Math.ln(num)
 Math.log(num)
end

.logn(num, base) ⇒ Float

Returns the log of num in base base.

Examples:

Math.logn(10000,10) 
=> 4.00

Returns:

  • (Float)

    the log of num in base base



25
26
27
# File 'lib/sixarm_ruby_ramp/math.rb', line 25

def Math.logn(num,base)
  Math.ln(num)/Math.ln(base)
end