POW()
All functions > MATH > POW()
Returns a number raised to the power of another number.
Signatures
Power
Returns: Base raised to the power of exponent
POW(base: T, exponent: T) → T sql
| Parameter | Type | Required | Description |
|---|---|---|---|
base | T | Yes | The base number |
exponent | T | Yes | The exponent |
With:
T: Any numeric type
Signature notes:
- Both arguments must be the same numeric type (both integer or both floating-point)
POW(x, 0) = 1for any non-zero xPOW(0, y) = 0for positive y- Returns NULL if either input is NULL
- Alias: POWER
Aliases
POWER
Related operators
Examples
POW(...)
FeatureQL
SELECT
f1 := POW(2, 3) -- Function call
;Result
| f1 BIGINT |
|---|
| 8 |
.POW(...) — chained
FeatureQL
SELECT
f1 := (2).POW(3), -- Integer literal: parenthesize for `.POW` on BIGINT
f2 := 2E0.POW(3E0) -- DOUBLE operands: chain without extra parentheses (same-type floating-point power)
;Result
| f1 BIGINT | f2 VARCHAR |
|---|---|
| 8 | 8.0 |
Edge cases
FeatureQL
SELECT
f1 := POW(5, 2), -- Square
f2 := POW(10, 0), -- Exponent zero
f3 := POW(2.0E0, -2.0E0), -- Negative exponent (DOUBLE)
f4 := POW(4.0E0, 0.5E0) -- Fractional exponent (DOUBLE)
;Result
| f1 BIGINT | f2 BIGINT | f3 VARCHAR | f4 VARCHAR |
|---|---|---|---|
| 25 | 1 | 0.25 | 2.0 |