llPow
function
Function syntax
float llPow(float base,// Base number.float exponent// Exponent number.
);- Returns
float- Energy
- 10
Returns NaN when base is negative and exponent is not an integer (an imaginary result, (exponent != (integer)exponent) && (base < 0.0)).
Returns a float that is base raised to the power exponent (baseexponent)
float result = llPow(0.0, 0.0);Caveats
Section titled “Caveats”- If exponent is a static integer and not a variable,
llPowis dramatically slower than simple repeated multiplication, i.e. it’s much faster to doval = base*base*baseinstead ofval = llPow(base, 3). - Triggers a Math Error for imaginary results if not compiled in Mono.
Examples
Section titled “Examples”Example 1
default { state_entry() { llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) (" + (string)llSqrt(5) + ")."); }}See also
Section titled “See also”Functions
Section titled “Functions”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.