Skip to content

Instantly share code, notes, and snippets.

@jcf
Created February 19, 2010 18:16
Show Gist options
  • Save jcf/309000 to your computer and use it in GitHub Desktop.
Save jcf/309000 to your computer and use it in GitHub Desktop.
Check out the Factorial repo for more http://github.com/jcf/factorial
module Math
def self.factorial(f)
f == 0 ? 1 : f * factorial(f - 1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment