Table of Contents

Start Functions Events Constants Types Language Articles

Function: llCeil

integer llCeil(float fval)

Round a float up to the closest integer greater than or equal to it.

Parameters

fval

The float value to be rounded up.

Return value

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

Notes

Short examples

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

See also