Unofficial LSL Reference

[[functions:llfabs]]


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:llfabs [2015-01-11 13:35 SLT]
sei Add introduction, style changes
functions:llfabs [2015-02-04 13:07 SLT] (current)
sei remove extra bracket
Line 10: Line 10:
 ===== Parameters ===== ===== Parameters =====
  
-=== FloatVal ​=== +=== fval === 
-Any [[types/float]] value (can be negative)+Any $lty[float] value (can be negative)
  
 ===== Return value ===== ===== Return value =====
  
-Returns a [[types/float]] that is the absolute value of **fval**, that is, the value with any negative sign removed.+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 **fval** if **fval** is positive or zero, and -**fval** if it is negative.+More rigorously, the result will be the same as $prm[fvalif $prm[fvalis positive or zero, and $prm[-fvalif it is negative.
  
 ===== Notes ===== ===== Notes =====
  
-  * To determine the absolute value of an [[types/integer]], use [[llAbs]]. +  * To determine the absolute value of an $lty[integer], use $lfn[llAbs]. 
-  * "Minus zero" (-0.0) is a special case of a [[types/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). +  * "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 **Infinity** ​and **-Infinity** ​is **Infinity**.+  * The absolute value of $nan is $nan. The absolute value of $pinf and $minf is $pinf.
  
 ===== Short examples ===== ===== Short examples =====
Line 38: Line 38:
 ===== See also ===== ===== See also =====
  
-  * [[llAbs]] takes the absolute value of an [[types/integer]]. +  * $lfn[llAbs] takes the absolute value of an $lty[integer]. 
-  * [[llVecMag]] takes the norm (magnitude) of a [[types/vector]].+  * $lfn[llVecMag] takes the norm (magnitude) of a $lty[vector].