Categories: Math
POW, POWER
Returns the base value raised to the specified power. POW is an alias of POWER.
Syntax
POW(numeric_expression double, power double) → double
- 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
SELECT POW(2, 10)
-- 1024.0
SELECT POW(NULL, 10)
-- null
POWER(numeric_expression numeric, power numeric) → double
- 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
SELECT POWER(2, 10)
-- 1024.0
SELECT POWER(NULL, 2)
-- null
Usage Notes
This function returns a double even if the parameters are both integers.