Skip to content

Instantly share code, notes, and snippets.

@scizo
Created August 17, 2012 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scizo/3375107 to your computer and use it in GitHub Desktop.
Save scizo/3375107 to your computer and use it in GitHub Desktop.
recursive factorial
(defn factorial [n]
(loop [n n
tally 1]
(if (< n 1)
tally
(recur (dec n) (* n tally)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment