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
xbetweenlowandhigh. Maxdoes not look inside an array: Max(scores) givesNaN. Pass the cells, or walk the array withFOR.- A FUNCTION named
Maxin your program replaces this one.
Example
hp = 130hp = Min(Max(hp, 0), 100)Console(Str(hp)) ' 100Console(Str(Max(3, 9, 12))) ' 12In the manual : Constants and operators