Description
The max
function returns the largest value from a list of provided numbers.
Syntax
max(Number1, Number2[, Number3...])
Arguments
Argument | Description |
---|---|
Number1, Number2, ... |
A list of numbers from which the largest value is to be determined. |
Return Types
The function returns the largest value of the provided numbers. The return value is of type number (number
).
Examples
Example | Result |
---|---|
max(3, 7, 2, 5) |
7 |
max(-10, -3, -7, -1) |
-1 |
max(42) |
42 |
Notes
- The function can accept any number of arguments.
- If only one argument is provided, the function returns that argument.
- The function supports both positive and negative numbers.
Comments
0 comments
Please sign in to leave a comment.