Difference between revisions of "LlSqrt"
Jump to navigation
Jump to search
m |
|||
Line 35: | Line 35: | ||
|cat3 | |cat3 | ||
|cat4 | |cat4 | ||
|haiku={{Haiku|Gleaming in the sun|the water gun | |haiku={{Haiku|Gleaming in the sun|the water gun lays broken.|It's SQuare RooT not SQuiRT.}} | ||
}} | }} |
Revision as of 15:15, 14 August 2013
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: float llSqrt( float 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
<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.