Skip to content

Instantly share code, notes, and snippets.

@bhenry
Created March 13, 2010 05:04
Show Gist options
  • Save bhenry/331123 to your computer and use it in GitHub Desktop.
Save bhenry/331123 to your computer and use it in GitHub Desktop.
(defn fact [x]
(if (< x 2) ;; the <= avoids error if non-integer is entered.
1
(* x (fact (dec x)))))
(fact 10)
;;3628800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment