Skip to main content
Version: current [25.x]

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 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

POWER(numeric_expression double, power double) → float8

  • 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

Usage Notes

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