6 lines
114 B
Clojure
6 lines
114 B
Clojure
(defn factorial [x]
|
|
(loop [x x
|
|
acc 1]
|
|
(if (< x 2)
|
|
acc
|
|
(recur (dec x) (* acc x)))))
|