PWR()

PWR()

Top  Previous  Next

 

The PWR() function returns the value of a number raised to a given power.

 

 

Format

 

PWR(expr, pwr.expr)

 

where

 

exprevaluates to a number or a numeric array.

 

pwr.exprevaluates to a number or a numeric array.

 

 

The PWR() function returns the value of expr raised to the power pwr.expr. It is equivalent to use of the ** operator.

 

If either expr or pwr.expr is a numeric array (a dynamic array where all elements are numeric), the PWR() function operates on each element in turn and returns another numeric array. The structure of this array will be the same as that of the expr and pwr.expr arrays if they are identical. For arrays of differing structure, the structure of the result depends on whether the REUSE() function is used.

 

 

Example

 

N = PWR(T, 3)

 

This statement finds the value of T cubed. For small integer values of pwr.expr, use of the multiply operator is faster.