Skip to main content
Scalar function
Aliases: pow Returns NULL when an argument is NULL.

Syntax

Scalar

Arguments

Returns

  • Type: DOUBLE for a converted floating base; the decimal base type for a decimal base
  • Possible values: The numeric power represented in the return type.
  • NULL behavior: Returns NULL when an argument is NULL.

Properties

  • Approximation bound: No fixed maximum error is guaranteed.

Usage notes

  • INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
  • Exact result: Floating-point computation can round the mathematical result.

Examples

Value and NULL input

Negative and fractional exponents

Limitations

  • Zero raised to a negative exponent raises an execution error.
  • Decimal powers keep the base’s precision and scale. They can overflow, and calculations using floating point can round the result.
  • A DECIMAL base produces a DECIMAL result with the same precision and scale, even when query tools report DOUBLE. Integer powers can raise an overflow error. Rescaling these powers discards extra fractional digits.
Last modified on October 15, 2026