Syntax

Gives the largest of the values it receives, however many there are.

Max(<value>, <value> [, <value>…])

Parts

<value>A number. Text that holds a number, such as "12", is read as that number.

Returns

The largest value, as a number. NaN when one value is not a number. With no value at all, -Infinity.

Good to know

  • Min(Max(x, low), high) keeps x between low and high.
  • Max does not look inside an array: Max(scores) gives NaN. Pass the cells, or walk the array with FOR.
  • A FUNCTION named Max in your program replaces this one.

Example

hp = 130hp = Min(Max(hp, 0), 100)Console(Str(hp))   ' 100Console(Str(Max(3, 9, 12)))   ' 12
In the manual : Constants and operators