POWER
8.0.9
The POWER instruction raises the contents of the source operand to the power of the contents of the second operand. It can optionally place the result in a third operand. It uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A Numeric Variable, numeric Literal, or Expression that is raised to a power.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
dest
Required. A Numeric Variable that is the power to which {dest} is raised.
source1
Required. A Numeric Variable, numeric Literal, or Expression that is moved to the destination variable before being raised to the power of {source1}.
sep2
Required. A comma or the keyword GIVING.
source2
Required. A Numeric Variable to which the {source2} variable is moved before being raised to the value of {source1}.
Flags Affected: LESS, OVER, ZERO
Note the following:
The result is placed in the last operand specified {dest} and the other operands always remain unchanged.
If format 2 is specified, the value in {source2} is moved into {dest} then {source1} is applied against {dest}.
The EQUAL (or ZERO), OVER, and LESS Condition Flags are applicable.
The rounding and truncation rules described in the section Numeric Variable are applicable.
If the environment variable PLB_ROUND is present, the result is rounded in accordance with the ANSI PL/B specification. Otherwise, the source operand is aligned and rounded, as applicable, to the destination operand's format.
This instruction supports the mixing of variable types (FORM and INTEGER).
Enhanced Array processing is supported.
POWER is not available when using the PLBCE runtime.
See Also: Example Code, CALC, MOVE, Mathematical Instructions
![]() |