Math > Math.floor

Math.floor

Syntax

Math.floor(x);

Arguments

x A number or expression.

Description

Method; returns the floor of the number or expression specified in the argument x. The floor is the closest integer that is less than or equal to the specified number or expression.

Player

Flash 5 or later. In the Flash 4 Player, the methods and properties of the Math object are emulated using approximations and may not be as accurate as the non-emulated math functions supported by the Flash 5 Player.

Example

The following returns a value of 12:

Math.floor(12.5);