Difference between revisions of "LlSqrt"
Jump to navigation
Jump to search
m (lsl code tagging) |
m |
||
Line 4: | Line 4: | ||
|func_sleep=0.0 | |func_sleep=0.0 | ||
|func_energy=10.0 | |func_energy=10.0 | ||
|func_footnote=Triggers a [[LSL_Math_Error|Math Error]] for imaginary results (val < 0.0) | |func_footnote=Triggers a [[LSL_Math_Error|Math Error]] for imaginary results ('''val''' < 0.0) | ||
|p1_type=float|p1_name=val|p1_desc=positive number (val >= 0.0) | |p1_type=float|p1_name=val|p1_desc=positive number (val >= 0.0) | ||
|return_type=float | |return_type=float | ||
|return_text=that is the square root of val. | |return_text=that is the square root of '''val'''. | ||
|spec | |spec | ||
|caveats=* Crashes the script if passed a negative number. | |caveats=* Crashes the script if passed a negative number. |
Revision as of 18:12, 11 December 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: float llSqrt( float = 0.0)" style="border-bottom:1px dotted; cursor:help;">val );4 | Function ID |
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
Examples
<lsl> default {
state_entry() { float num1 = llFrand(100.0);
llOwnerSay("The square root of " + (string)num1 + " is " + (string)llSqrt(num1)); }
}
</lsl>Notes
If you need the square root of two use SQRT2.