$nav
===== Function: llFabs =====
float llFabs(float fval)
Return the absolute value of the parameter (for floats).
===== Parameters =====
=== fval ===
Any $lty[float] value (can be negative)
===== Return value =====
Returns a $lty[float] that is the absolute value of $prm[fval], that is, the value with any negative sign removed.
More rigorously, the result will be the same as $prm[fval] if $prm[fval] is positive or zero, and $prm[-fval] if it is negative.
===== Notes =====
* To determine the absolute value of an $lty[integer], use $lfn[llAbs].
* "Minus zero" (-0.0) is a special case of a $ty[float] that can rarely appear in some situations. The absolute value of Minus zero is returned by this function unchanged (as -0.0). This should not be a concern anyway, as minus zero is mostly transparent to all calculations (e.g. minus zero is considered equal to zero, and doesn't err when taking its square root).
* The absolute value of $nan is $nan. The absolute value of $pinf and $minf is $pinf.
===== Short examples =====
float F = -2.25;
F = llFabs(F); // sets F to 2.25
F = llFabs(F); // F is still 2.25 because it was already positive
F = llFabs(0.0); // sets F to zero
F = llFabs(-PI); // sets F to approx. 3.141593
F = llFabs(0.5); // sets F to 0.5
===== See also =====
* $lfn[llAbs] takes the absolute value of an $lty[integer].
* $lfn[llVecMag] takes the norm (magnitude) of a $lty[vector].