Categories: Math
POW, POWER
Returns the result of raising the input value to the specified power.
Syntax
POW(numeric_expression double, power double) → float8
- numeric_expression: The input expression.
- power: The power to raise the numeric_expression to.
Examples
POW exampleSELECT POW(5, 2)
-- 25.0
SELECT POW(0.1, 2)
-- 0.010000000000000002
SELECT POW(-2, 2)
-- 4.0
SELECT POW(10, -2)
-- 0.01
POWER(numeric_expression double, power double) → float8
- numeric_expression: The input expression.
- power: The power to raise the numeric_expression to.
Examples
POWER exampleSELECT POWER(5, 2)
-- 25.0
SELECT POWER(0.1, 2)
-- 0.010000000000000002
SELECT POWER(-2, 2)
-- 4.0
SELECT POWER(10, -2)
-- 0.01
Usage Notes
This function returns a float even if the parameters are both integers.