math.max()

Type Function
Library math.*
Return value Number
Revision Release 2024.3703
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