class Mathematics::Factorial

Public Class Methods

new() click to toggle source
# File lib/math/factorial.rb, line 3
def initialize()
end

Public Instance Methods

factorial(n) click to toggle source
# File lib/math/factorial.rb, line 6
def factorial(n)
    if n == 0
        return 1
        else
        return n * factorial(n - 1)
    end
end