1.3.0 permalink Arrow_down_16x16
  • (max x)
  • (max x y)
  • (max x y & more)
Returns the greatest of the nums.

2 Examples top

  • user=> (max 1 2 3 4 5)  
    5
    user=> (max 5 4 3 2 1)
    5
    user=> (max 100)
    100
    
  • ;; If elements are already in a sequence, use apply
    user=> (apply max [1 2 3 4 3])
    4
    user=> (apply max '(4 3 5 6 2))
    6
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:1050 top

(defn max
  "Returns the greatest of the nums."
  {:added "1.0"
   :inline-arities >1?
   :inline (nary-inline 'max)}
  ([x] x)
  ([x y] (. clojure.lang.Numbers (max x y)))
  ([x y & more]
   (reduce1 max (max x y) more)))
Vars in clojure.core/max:
Used in 0 other vars

Comments top

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