Difference between revisions of "LlAbs"

From Second Life Wiki
Jump to navigation Jump to search
m (fix lowercase)
Line 1: Line 1:
  {{lowercase|llAbs}}
  {{lowercase|llAbs}}
__NOTOC__
__NOTOC__
{| width="100%"
|-
|valign="top"|
<div id="box">
<div style="padding: 0.5em">
Returns the absolute value of the integer passed to it.
Returns the absolute value of the integer passed to it.
</div>
</div>
|-
|<div id="box">
== [[integer]] llAbs( [[integer]] number); ==
<div style="padding: 0.5em">
* number - Any valid integer value
</div>
</div>
|-
|
<div id="box">
== Specification ==
<div style="padding: 0.5em">
This function returns the absolute value passed to it. Basically, it removes the negative sign, on the number if there is one. If the parameter is a positive one, it just returns it
</div>
</div>
|-
|
<div id="box">
== Caveats ==
<div style="padding: 0.5em">
* None Known
</div>
</div>


==Syntax==
|-
integer llAbs(integer number);
|
* number may be any integer.
<div id="box">
 
== Examples ==
==Specification==
<div style="padding: 0.5em">
This function returns the absolute value of the number given to it.  If the number passed is less than zero, then it will return the opposite of that number.  If it is greater than or equal to zero, it will return the number given to it.
<lsl>
<!--In other words:
default
 
{
<math>f(n) =
    state_entry()
\begin{cases}
    {
x,  & \mbox{if }x \ge 0 \\
        llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
-x, & \mbox{if }x < 0
    }
\end{cases}</math>-->
}
 
</lsl>
==Caveats==
* None known at this time.
 
==Examples==
<blockquote><pre>
llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
</pre></blockquote>


==See also==
</div>
</div>
|-
|
<div id="box">
== See Also ==
<div style="padding: 0.5em">
</div>
</div>
|-
|
<div id="box">
== Notes ==
<div style="padding: 0.5em">
</div>
</div>
|}

Revision as of 21:56, 24 January 2007

The correct title of this article is llAbs. The initial letter is shown capitalized due to technical restrictions.


Returns the absolute value of the integer passed to it.

integer llAbs( integer number);

  • number - Any valid integer value

Specification

This function returns the absolute value passed to it. Basically, it removes the negative sign, on the number if there is one. If the parameter is a positive one, it just returns it

Caveats

  • None Known

Examples

<lsl> default {

   state_entry()
   {
       llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
   }

} </lsl>

See Also

Notes