## LSL Wiki : llCeil

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
integer llCeil(float val);

Returns the smallest integer value >= val (rounds up).

The usage of these functions can be tricky. For examples of potential issues see llFrand.

Compare with llFloor and llRound.

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Math
Um... whats the use of this?
-- ChristopherOmega (2004-01-15 16:18:06)
Rounds up.
-- GuzarFonzarelli (2004-01-18 11:15:47)
Be careful that the value you pass to this function is a float, not an integer. For example, llCeil(1/4) returns 0, while llCeil(1.0/4.0) returns 1. That's because 1 / 4 = 0 in integer math, and llCeil(0) is 0.
-- GunzourYellowknife (2004-06-28 12:08:21)
This is also very useful for llFrand, since that returns 0.0 < x <= MAX (instead of the usual 0.0 <= x < MAX). use llCeil for this to properly convert x into an integer.
-- NeoRebus (2004-07-07 15:46:06)
Erm, neo..... llFrand(MAX) returns 0.0 <= x < MAX. Also llCeil wouldn't help you get anything closer to 0.0 <= x < MAX if it actually did return 0.0 < x <= MAX.

However your surrounding premise is I think correct since llCeil(llFrand(MAX)) will return an integer from 1 to MAX ( 0 < X <= MAX ).
-- AmaOmega (2004-07-10 01:18:41)
Um, how come the llFrand page says it returns (0.0 < return value <= max) then?
-- PrioSerpentine (2004-07-10 08:27:01)
Because it is wrong would be my guess. :)
-- AmaOmega (2004-07-10 23:07:08)
Looks to me like this function returns the smallest integer value > than the value, as opposed to >= the value.
-- 206.12.10.243 (2007-12-10 18:55:21)
I take it back... Disregard the last comment. Further testing has proven me wrong.
-- 206.12.10.243 (2007-12-11 17:41:03)