Module: Math

Defined in:
lib/ruby-util/math.rb

Class Method Summary collapse

Class Method Details

.root(x, n) ⇒ Object

Calculates the nth root of a x.



4
5
6
# File 'lib/ruby-util/math.rb', line 4

def root(x, n)
  x ** (1.0 / n)
end