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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

functions:llceil [2014-05-16 05:28 SLT]
sei [Function: llCeil] round up
functions:llceil [2015-02-04 13:08 SLT] (current)
sei inf handling
Line 1: Line 1:
 +$nav
 ===== Function: llCeil ===== ===== Function: llCeil =====
  
Line 12: Line 13:
 The float value to be rounded up. The float value to be rounded up.
  
-===== Result ​=====+===== Return value =====
  
-Returns the float value that is the nearest integer ​greater or equal to **fval**.+Returns the nearest $lty[integer] ​value that is greater ​than or equal to $prm[fval].
  
 ===== Notes ===== ===== Notes =====
  
-  * The function returns -2147483648 (Hex. 80000000) for float values of 2147483648.0 or bigger, or less than -2147483648.0.+  * The function returns -2147483648 (Hex. 0x80000000) for float values of 2147483648.0 or bigger ​(including $pinf), or less than -2147483648.0 ​(including $minf), or $nan.
  
 ===== Short examples ===== ===== Short examples =====
Line 24: Line 25:
 <code lsl2> <code lsl2>
 integer i; integer i;
-i = llCeil(3.0); ​   // i will become ​3, which is greater or equal to 3.0 (in this case, equal). +i = llCeil(3.0); ​   // Sets to 3, which is greater or equal to 3.0 (in this case, equal). 
-i = llCeil(3.001); ​ // i will become ​4, not 3, because 3 is less than 3.001 and the result must be greater or equal. +i = llCeil(3.001); ​ // Sets to 4, not 3, because 3 is less than 3.001 and the result must be greater or equal. 
-i = llCeil(3.999); ​ // i will become ​+i = llCeil(3.999); ​ // Sets to 
-i = llCeil(4.0); ​   // i will become ​+i = llCeil(4.0); ​   // Sets to 
-i = llCeil(-3.0); ​  // i will become ​-3 +i = llCeil(-3.0); ​  // ​Sets to -3 
-i = llCeil(-3.001);​ // i will become ​-3, which is greater or equal to -3.001 (in this case, greater) +i = llCeil(-3.001);​ // Sets to -3, which is greater or equal to -3.001 (in this case, greater) 
-i = llCeil(-3.999);​ // i will become ​-3 +i = llCeil(-3.999);​ // Sets to -3 
-i = llCeil(-4.0); ​  // i will become ​-4+i = llCeil(-4.0); ​  // ​Sets to -4
 </​code>​ </​code>​
  
 ===== See also ===== ===== See also =====
  
-  * [[llRound]] rounds to nearest integer. +  * $lfn[llRound] rounds to nearest integer. 
-  * [[llFloor]] rounds always towards negative infinity (e.g. 1.1 is rounded down to 1.0 and -1.1 is rounded down to -2.0). +  * $lfn[llFloor] rounds always towards negative infinity (e.g. 1.1 is rounded down to 1.0 and -1.1 is rounded down to -2.0). 
-  * [[types/float]] type and associated caveats and limitations.+  * $lty[float] type and associated caveats and limitations.