Difference between revisions of "LlSqrt"

From Second Life Wiki
Jump to navigation Jump to search
m (Adding an example)
Line 11: Line 11:
|caveats=* Crashes the script if passed a negative number.
|caveats=* Crashes the script if passed a negative number.
|constants
|constants
|examples
|examples=<pre>
default
{
  state_entry()
  {
    float num1 = llFrand(100.0);
 
    llOwnerSay("The square root of " + (string)num1 + " is " + (string)llSqrt(num1));
  }
}
</pre>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llLog]]|}}
|also_functions={{LSL DefineRow||[[llLog]]|}}

Revision as of 16:31, 22 May 2007

Summary

Function: float llSqrt( float = 0.0)" style="border-bottom:1px dotted; cursor:help;">val );
0.0 Forced Delay
10.0 Energy

Returns a float that is the square root of val.

• float val positive number (val >= 0.0)

Triggers a Math Error for imaginary results (val < 0.0)

Caveats

  • Crashes the script if passed a negative number.

Examples

default
{
  state_entry()
  {
    float num1 = llFrand(100.0);

    llOwnerSay("The square root of " + (string)num1 + " is " + (string)llSqrt(num1));
  }
}

See Also

Functions

•  llLog
•  llLog10
•  llPow

Deep Notes

Signature

function float llSqrt( float val );