Top

Name

floor — Returns the largest integer that is not greater than the argument.

Synopsis

integer floor ( num number );
 

Description

This function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer. In other words, it "rounds down" the given value.

Parameters

num

The value to be "rounded down"

Return Types

Examples

Example 24.587. 

The following expressions are true:

floor(2.5) = 2
floor(2) = 2
floor(-2.5) = -3
floor(-2) = -2