If no denominators are supplied, returns 1/numerator,
else returns numerator divided by all of the denominators.
user=> (/ 6 3) 2 user=> (/ 6 3 2) 1 user=> (/ 10) 1/10 user=> (/ 1 3) 1/3 user=> (/) java.lang.IllegalArgumentException user=> (/ 1 0) java.lang.ArithmeticException user=> (/ 0) java.lang.ArithmeticException
(defn /
"If no denominators are supplied, returns 1/numerator,
else returns numerator divided by all of the denominators."
{:inline (fn [x y] `(. clojure.lang.Numbers (divide ~x ~y)))
:inline-arities #{2}
:added "1.0"}
([x] (/ 1 x))
([x y] (. clojure.lang.Numbers (divide x y)))
([x y & more]
(reduce / (/ x y) more)))
Comments top
No comments for /. Log in to add a comment.