-
Notifications
You must be signed in to change notification settings - Fork 0
llFabs
Serra Royale edited this page Jun 11, 2025
·
1 revision
Returns a float that is the positive version of val.
This function is similar to functions (e.g. fabs) found in many other languages, such as C++.
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.500000
- Using
val-2*val*(val<0)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.