Module: RubyExtension::Integer::InstanceMethods

Defined in:
lib/ruby_extension/integer.rb

Overview

module ClassMethods # :nodoc: end

Instance Method Summary collapse

Instance Method Details

#factorialObject

Return n!



16
17
18
19
20
# File 'lib/ruby_extension/integer.rb', line 16

def factorial
	f = n = self
	f *= n -= 1 while( n > 1 )
	return f
end