You're viewing version 1.2.0 of *. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (*)
  • (* x)
  • (* x y)
  • (* x y & more)
Returns the product of nums. (*) returns 1.

1 Example top

  • (* 6) ;=> 6
    (* 2 3) ;=> 6
    (* 2 3 4) ;=> 24
    (* 0.5 200) ;=> 100.0
    (* 1234567890 9876543210) ; ArithmeticException integer overflow
Log in to add / edit an example.

See Also top

  • 0
    clojure.core/*'

    Returns the product of nums. (*) returns 1. Supports arbitrary precisi

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:820 top

(defn *
  "Returns the product of nums. (*) returns 1."
  {:inline (fn [x y] `(. clojure.lang.Numbers (multiply ~x ~y)))
   :inline-arities #{2}
   :added "1.0"}
  ([] 1)
  ([x] (cast Number x))
  ([x y] (. clojure.lang.Numbers (multiply x y)))
  ([x y & more]
   (reduce * (* x y) more)))
Vars in clojure.core/*: cast defn reduce

Comments top

No comments for *. Log in to add a comment.