Skip to content

Commit

Permalink
Use the FactorialTable only for suitable values.
Browse files Browse the repository at this point in the history
  • Loading branch information
oldgreen committed May 3, 2012
1 parent 00850c0 commit d13ddab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/common/math19.rb
Expand Up @@ -49,7 +49,7 @@ def gamma(x)

if fractional == 0.0
raise DomainError, "gamma" if int < 0
return FactorialTable[int - 1]
return FactorialTable[int - 1] if int <= FactorialTable.size
end
end

Expand Down

0 comments on commit d13ddab

Please sign in to comment.