Skip to content

clojure.core/max

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 3 Runnable: 3
([x] [x y] [x y & more])

Returns the greatest of the nums.

Examples

by MrHus on
by mydoghasworms on
by zjliu1984 on

Note by zk

As of 1.6, max's behavior differs when it's passed single / multiple non-numeric arguments:

(max "foo") ;;=> "foo"

(max "foo" "bar") ;;=> ClassCastException thrown

Note by burbma

;; Be warned
user=> (max 1 nil)
java.lang.NullPointerException

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.