Module: Math

Defined in:
lib/tonal/extensions.rb

Constant Summary collapse

PHI =
(1 + 5**(1.0/2))/2

Class Method Summary collapse

Class Method Details

.factorial(limit) ⇒ Integer

Returns the factorial of n.

Examples:

Math.factorial(10) => 3628800

Parameters:

  • limit

Returns:



401
# File 'lib/tonal/extensions.rb', line 401

def self.factorial(limit) = (2..limit).reduce(1, :*)