Table of Contents

Start Functions Events Constants Types Language Articles

Function: llSqrt

float llSqrt(float fval)

Return the square root of the argument, that is, a number such that when multiplied by itself, results in the given argument.

Parameters

fval

The float value to take the square root of.

Return value

The square root of the given float.

Notes

Short examples

float f;
f = llSqrt(4);  // sets f to 2.0 because 2*2=4
f = llSqrt(25); // sets f to 5.0 because 5*5=25
f = llSqrt(2);  // sets f to approx. 1.414214, which multiplied by itself gives approx. 2
f = SQRT2;      // same as above, but more efficient
f = llSqrt(-1); // sets f to NaN (Not a Number) under Mono; crashes under LSO

See also