POW
All functions > MATH > POW
Returns the value of a number raised to the power of another number.
Signatures
Returns: the value of the base raised to the power of the exponent
POW(base: T, exponent: T) → T sql
| Parameter | Type | Required | Description |
|---|---|---|---|
base | T | Yes | The base number |
exponent | T | Yes | The power to raise the base to |
Notes
POW(x, 0) = 1for any non-zero xPOW(0, y) = 0for positive yPOW(1, y) = 1for any y- Returns NULL if either input is NULL
- Can result in very large or very small numbers
- For negative bases with fractional exponents, result may be complex
- Operator form:
base ^ exponent - Alias: POWER(base, exponent)
Aliases
POWER
See also
Examples
FeatureQL
SELECT
f1 := POW(2, 3), -- 2 to the power of 3
f2 := POW(5, 2), -- 5 squared
f3 := POW(10, 0), -- Any number to power 0 is 1
f4 := POW(2.0e0, -2.0e0), -- Negative exponent
f5 := POW(4.0e0, 0.5e0) -- Square root via power
;Result
| f1 BIGINT | f2 BIGINT | f3 BIGINT | f4 VARCHAR | f5 VARCHAR |
|---|---|---|---|---|
| 8 | 25 | 1 | 0.25 | 2.0 |
On this page