RosettaCodeData/Task/Greatest-common-divisor/Clojure/greatest-common-divisor-1.clj
2016-12-05 22:15:40 +01:00

6 lines
129 B
Clojure

(defn gcd
"(gcd a b) computes the greatest common divisor of a and b."
[a b]
(if (zero? b)
a
(recur b (mod a b))))