NAME

max - maximum of two or more values

SYNOPSIS

res = a.max(b)
res = a.max(b, c, ...)

DESCRIPTION

Returns the maximum of its arguments.

If called with two arguments, max returns the larger of a and b. If either a or b is an array, the operation is vectorized across the arrays.

If called with more than two arguments, max returns the maximum of all provided arguments.

For strings, max uses lexicographical order.

RETURN VALUE

Returns the maximum of the inputs.

ERRORS

ArgCheck: Thrown if fewer than 2 arguments are provided.
TypeCheck: Thrown if the arguments are not comparable.
ShapeCheck: Thrown if the arguments are arrays with incompatible shapes.

EXAMPLE

    10->max(20)
20

    1->max(2, 3, 4)
4

    [1, 5, 3].max(2)
2 5 3

    "apple".max("banana")
"banana"

SEE ALSO

min
maxval