function/macro | since v0.0-927 | clojure.core// | Edit |
(/ x)
(/ x y)
(/ x y & more)
If no denominators are supplied, returns 1/numerator, else returns numerator divided by all of the denominators.
(/ 6 3)
;;=> 2
(/ 6 3 2)
;;=> 1
(/ 10)
;;=> 0.1
(/ 1 3)
;;=> 0.3333333333333333
If no denominators are supplied, returns 1/numerator, else returns numerator divided by all of the denominators.
(defn ^number /
([x] (/ 1 x))
([x y] (cljs.core/divide x y)) ;; FIXME: waiting on cljs.core//
([x y & more] (reduce / (/ x y) more)))
(core/defmacro ^::ana/numeric /
([x] `(/ 1 ~x))
([x y] (core/list 'js* "(~{} / ~{})" x y))
([x y & more] `(/ (/ ~x ~y) ~@more)))