Skip to content

Instantly share code, notes, and snippets.

@jackhooper
Created January 1, 2014 14:29
Show Gist options
  • Save jackhooper/8208442 to your computer and use it in GitHub Desktop.
Save jackhooper/8208442 to your computer and use it in GitHub Desktop.
Calculates the factorial of n. Written in Clojure
; Calculates factorial of n
; Jack Hooper 2014
(defn factorial [n]
(reduce * (range (inc n))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment