$power

Calculate the value of X raised to the power of Y (XY).

$power(X, Y)

Parameters

X and Y—numeric constant, or field (or indirect reference to a field), variable, function, or expression that evaluates to a numeric value.

Return Values

Calculated value of X raised to the power of Y.

If an error occurs, $procerror contains a negative value that identifies the exact error.

Values of $procerror Commonly Returned Following $power
Value  Error constant Meaning
-1204 <UPROCERR_NEGATIVE> Negative value not allowed
-1207 <UPROCERR_UNDERFLOW> Underflow
-1208 <UPROCERR_OVERFLOW> Overflow
-1209 <UPROCERR_DIVIDE> Divide by zero

Use

Allowed in all component types.

Description

The function $power calculates the value of X raised to the power of Y ((XY).

If X is less than zero, Y must be an integer.

The absolute value of the result of $power must be in the range 10 -9999 through 10 9999 , inclusive.

Calculating a Cube Root

The following example computes the cube root of the value in MYFIELD:

vCubeRoot = $power(MYFIELD, 1/3)