1.3.0 permalink Arrow_down_16x16
  • (*)
  • (* x)
  • (* x y)
  • (* x y & more)
Returns the product of nums. (*) returns 1. Does not auto-promote
longs, will throw on overflow. See also: *'

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:943 top

(defn *
  "Returns the product of nums. (*) returns 1. Does not auto-promote
  longs, will throw on overflow. See also: *'"
  {:inline (nary-inline 'multiply 'unchecked_multiply)
   :inline-arities >1?
   :added "1.2"}
  ([] 1)
  ([x] (cast Number x))
  ([x y] (. clojure.lang.Numbers (multiply x y)))
  ([x y & more]
     (reduce1 * (* x y) more)))
Vars in clojure.core/*:
Used in 0 other vars

Comments top

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