LlFabs
Looking for the current API? Open the llFabs reference →
Return value notes
Returns a float that is the positive version of
val.Examples
default
{
state_entry()
{
llSay(0,"The (Float)absolute value of -4.5 is: "+(string)llFabs(-4.5) );
}
}
// returns :
// The (Float)absolute value of -4.5 is: 4.500000Notes
- Using
is roughly 60% faster than llFabs as it avoids a function call, though it produces NaN if given an infinite value and (correctly) returns 0.0 instead of -0.0 when taking the absolute value of negative zero.val-2*val*(val<0)
See also: functions
See also: articles
Shared wiki helpers
The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.
Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SCR-439|'''Mono only:''' [[llFabs]] of Negative Zero is negative, should be positive.|type=bug}}Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.