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

2 Examples top

  • user=> (min 1 2 3 4 5)  
    1
    user=> (min 5 4 3 2 1)
    1
    user=> (min 100)
    100
  • ;; If elements are already in a sequence, use apply
    user=> (apply min [1 2 3 4 3])
    1
    user=> (apply min '(4 3 5 6 2))
    2
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:920 top

(defn min
  "Returns the least of the nums."
  {:added "1.0"}
  ([x] x)
  ([x y] (if (< x y) x y))
  ([x y & more]
   (reduce min (min x y) more)))
Vars in clojure.core/min: < defn reduce

Comments top

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