max

added
1.0

ns
clojure.core

type
function

(max x) (max x y) (max x y & more)

Returns the greatest of the nums.

                ;; `max` returns the largest of its arguments
user=> (max 1 2 3 4 5)  
5

;; regardless of order of those arguments
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
            
                user> (reduce max [1 2 3 4 5 6 7 6 5 4 3])
7