^ [exponentiation]
All functions > MATH > ^ [exponentiation]
Raises a number to a power (integer or floating-point operands of the same type).
Syntax
base ^ exponent · base ** exponent · POW(base, exponent)
Notes
- Both operands must be the same numeric type (both integer or both floating-point)
POW(x, 0)is 1 for any non-zero x;POW(0, y)is 0 for positive y- Returns NULL if either input is NULL
- You can write the operator as
^or**
Related Functions
Examples
^ and ** — integers
FeatureQL
SELECT
f1 := 2 ^ 3, -- Caret exponentiation
f2 := 2 ** 3 -- Double-asterisk exponentiation
;Result
| f1 BIGINT | f2 BIGINT |
|---|---|
| 8 | 8 |
^ and ** — floating-point
FeatureQL
SELECT
f1 := 2.0E0 ^ (-2.0E0), -- Negative exponent
f2 := 4.0E0 ^ 0.5E0 -- Fractional exponent
;Result
| f1 VARCHAR | f2 VARCHAR |
|---|---|
| 0.25 | 2.0 |