math.floor()

Type Function
Library math.*
Return value Number
Revision Release 2024.3703
Keywords floor
See also math.ceil()
math.round()

Overview

Returns the integer smaller than or equal to x.

Syntax

math.floor( x )
x (required)

Number. A number.

Examples

print( math.floor(0.5) )    ---> 0
print( math.floor(-0.5) )    ---> -1