Skip to main content

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 example
SELECT POW(5, 2)
-- 25.0
POW example
SELECT POW(0.1, 2)
-- 0.010000000000000002
POW example
SELECT POW(-2, 2)
-- 4.0
POW example
SELECT POW(10, -2)
-- 0.01
Raise 2 to the power of 10
SELECT POW(2, 10)
-- 1024.0
Return NULL for a NULL input
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 example
SELECT POWER(5, 2)
-- 25.0
POWER example
SELECT POWER(0.1, 2)
-- 0.010000000000000002
POWER example
SELECT POWER(-2, 2)
-- 4.0
POWER example
SELECT POWER(10, -2)
-- 0.01
Raise 2 to the power of 10
SELECT POWER(2, 10)
-- 1024.0
Return NULL for a NULL input
SELECT POWER(NULL, 2)
-- null

Usage Notes​

This function returns a double even if the parameters are both integers.