math.max()

Type Function
Library math.*
Return value Number
Revision Current Public Release (2017.3068)
Keywords max, maximum
See also math.min()

Overview

Returns the maximum value among its arguments.

Syntax

math.max( x, ... )
x (required)

Number. A number.

Examples

print(math.max(1.2, -7, 3))        --->3
print(math.max(0, -100000000))     --->0
print(math.max(0, 1/0, math.huge)) --->inf