lib/darkext/integer.rb
# Computes the factorial of the Integer
Computes the factorial of the Integer
Computes the factorial of the Integer
def fact
    raise ArgumentError.new('Cannot compute factorial of negative number') if 0 > self
    return 1 if self.zero?
    return (1..self).to_a.product
  end
def fact raise ArgumentError . new ( 'Cannot compute factorial of negative number' ) if 0 > self return 1 if self . zero? return ( 1 .. self ) . to_a . product end
Computes the factorial of the Integer
Computes the factorial of the Integer