POW/POWER Functions

Description

The POW function returns x to the power of y. POW and POWER are used interchangeably. The return value is a DOUBLE type.

Syntax

POW( x, y )

POWER( x, y )

Example

SELECT POWER(2, 5), POWER(-2, 5), POWER(0, 0), POWER(1,0);

 power(2, 5)            power(-2, 5)           power(0, 0)           power(1, 0)

======================================================================================

 3.200000000000000e+01    -3.200000000000000e+01     1.000000000000000e+00     1.000000000000000e+00

 

--it returns an error when the negative base is powered by a non-int exponent

SELECT POWER(-2, -5.1), POWER(-2, -5.1);

 

ERROR