Table of Contents

Start Functions Events Constants Types Language Articles

Function: llFloor

integer llFloor(float fval)

Round a float down to the closest integer less than or equal to it.

Parameters

fval

The float value to be rounded down.

Return value

Returns the nearest integer value that is less than or equal to fval.

Notes

Short examples

integer i;
i = llFloor(3.0);    // i will become 3, which is less or equal to 3.0 (in this case, equal).
i = llFloor(3.001);  // i will become 3, not 4, because 4 is greater than 3.001 and the result must be less or equal.
i = llFloor(3.999);  // i will become 3
i = llFloor(4.0);    // i will become 4
i = llFloor(-3.0);   // i will become -3
i = llFloor(-3.001); // i will become -4, which is less or equal to -3.001 (in this case, less)
i = llFloor(-3.999); // i will become -4
i = llFloor(-4.0);   // i will become -4

See also