# File lib/more/facets/math/factorial.rb, line 24 def self.factorial(n) n = Integer(n) if n < 0 nil elsif FACTORIALS.length > n FACTORIALS[n] else h = FACTORIALS.last (FACTORIALS.length .. n).each { |i| FACTORIALS.push h *= i } h end end