Skip to content
lsl.devlsl.devLSL Dev

llPow

function
Function syntax
float llPow(
  1. float base,// Base number.
  2. 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)

How to use
float result = llPow(0.0, 0.0);
  • If exponent is a static integer and not a variable, llPow is dramatically slower than simple repeated multiplication, i.e. it’s much faster to do val = base*base*base instead of val = llPow(base, 3).
  • Triggers a Math Error for imaginary results if not compiled in Mono.
Example 1
default {
state_entry() {
llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) ("
+ (string)llSqrt(5) + ").");
}
}
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.

From the Second Life Wiki

Community documentation adapted from LlPow, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

  • LlPow (revision 1215254, )

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.