Skip to content

llSqrt

float llSqrt(float Value)

Returns the square root of Value.

Triggers a math runtime error for imaginary results (if Value < 0.0).

Parameters
Value (float)
default
{
state_entry()
{
float num1 = llFrand(100.0);
llOwnerSay("The square root of " + (string)num1 + " is " + (string)llSqrt(num1));
}
}
  • Crashes the script if passed a negative number.
  • If you need the square root of two, you can use the constant SQRT2.
  • Other roots can be computed by llPow(val, 1.0/root).