Category: Number function
This function returns the largest of two numbers.
Argument | Type | Description |
---|---|---|
number1 | Number | The value to be compared to number2. |
number2 | Number | The value to be compared to number1. |
Return value type: Number
Use nested Max() functions to compare more than two values at a time. See the last two examples below.
max(10, 20) //Returns 20
max(171, 238) //Returns 238
max(1, -1) //Returns 1
max(max(8,4),12) //Returns 12 (Returns the max of the 3 values 8, 4, and 12.)
max(max(10, 40), max(25, 75)) //Returns 75 (Returns the max of the 4 values 10, 40, 25, and 75.)