Garry's Mod Wiki

math.floor

number math.floor( number number )

Description

Floors or rounds a number down.

Arguments

1 number number
The number to be rounded down.

Returns

1 number
floored numbers

Example

Round pi.

print(math.floor(math.pi))
Output: 3

Example

Demonstrates the difference between math.Round and math.floor.

local value = 3.6 print( math.Round( value ), math.floor( value ) )
Output: 4 3

Page Links


Special Pages


Wikis

?

Render Time: 40ms

DB GetPage 5
Generate Html 3
SaveChanges (1) 10
Render Body 0
Render Sidebar 19