Unofficial LSL Reference

[[functions:llfloor]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

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

  • The function returns -2147483648 (Hex. 0x80000000) for float values of 2147483648.0 (including Infinity) or bigger, or less than -2147483648.0 (including -Infinity), or NaN.

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

  • llRound rounds to nearest integer.
  • llCeil rounds always towards positive infinity (e.g. 1.1 is rounded up to 2.0 and -1.1 is rounded up to -1.0).
  • float type and associated caveats and limitations.