# llPow

*LSL function*

```lsl
float float llPow(float base, float exponent);
```

- `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](https://wiki.secondlife.com/wiki/float) that is **base** raised to the power **exponent** (**base**<sup>**exponent**</sup>)

```lsl title="How to use" frame="terminal"
float result = llPow(0.0, 0.0);
```

## Caveats

- 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](https://wiki.secondlife.com/wiki/Category:LSL_Error/Math) for imaginary results if not compiled in Mono.

## Examples

<details open>
<summary>Example 1</summary>

```lsl
default {
     state_entry() {
          llOwnerSay("llPow(5, .5) (" + (string)llPow(5, .5) + ") is equal to llSqrt(5) ("
                      + (string)llSqrt(5) + ").");
     }
}
```

</details>

## See also

### Functions

- [llLog](/functions/llLog/)
- [llLog10](/functions/llLog10/)
- [llSqrt](/functions/llSqrt/)

---

*Source: [LlPow](https://wiki.secondlife.com/wiki/LlPow) on the Second Life Wiki. Content from the Second Life Wiki article LlPow (revision 1215254, 2023-11-01), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llPow/
