Class: Integer
- Inherits:
-
Object
- Object
- Integer
- Defined in:
- lib/viral_seq/math.rb
Overview
additional functions for Class::Integer
Instance Method Summary collapse
-
#factorial ⇒ Integer
factorial method for an Integer.
Instance Method Details
#factorial ⇒ Integer
factorial method for an Integer
160 161 162 163 164 165 166 |
# File 'lib/viral_seq/math.rb', line 160 def factorial if self == 0 return 1 else (1..self).inject(:*) end end |