max
Syntax Format
max(lvalue, rvalue)
Overview
The max
function provides the value, which is greater among the given data type. The data type can be a series as well as a sequence of numbers. At least two values need to be present in the parameters of the function to receive a result. This function is useful in scripts where you need to determine the greater value among those, taken into calculation.
Parameters
Parameter | Type | Purpose |
---|---|---|
lvalue | numeric or series | First value, taken into calculation |
rvalue | numeric or series | Second value, taken into calculation |
Returns: series
if lvalue and/or rvalue is series
, numeric
otherwise.
Example
max_value = max(1, 5, 10) -- the result will be 10