Max

From Pico-8 Wiki
Jump to navigation Jump to search
max( first, [second] )
Returns the maximum of two numbers.
first
The first number.

second
The second number. (default 0)

Examples

print(max(40, 20))    -- 40

print(max(2.7, -3.5)) -- 2.7

print(max(8, 8))      -- 8

print(max(5))         -- 5

print(max(-5))        -- 0

See also