module MathStatisticsArrayMethods::IntegerFactorial

Will add the factorial method to the integers.

Public Instance Methods

factorial() click to toggle source

Classic factorial.

# File lib/math_statistics_array_methods/integer_factorial.rb, line 11
def factorial
        f = 1
        for i in 1..self do
                f *= i
        end
        return f
end