Mathematical Instructions
The arithmetic instructions perform the various PL/B mathematical functions. Except for the CALC instruction, they typically use the same general format.
|
Add two numbers with optional giving clause. | |
|
Calculate the arccosine of a value. | |
|
Calculate the arcsine of a value. | |
|
Calculate the arctangent of a value. | |
|
Calculate the arctangent of a value returns a value in the range –pi to pi radians. | |
|
Perform algebraic type calculation. | |
|
Perform a check digit calculation. | |
|
Perform a check digit calculation. | |
|
Compare two numbers. | |
|
Calculate the cosine of a value. | |
|
Calculate the hyperbolic cosine of a value. | |
|
Decrement a variable by one. | |
|
Divide two numbers with optional giving clause. | |
|
Calculate the natural exponent of a value. | |
|
Increment a variable by one. | |
|
Calculate the natural log of a value. | |
|
Calculate the base 10 log of a value. | |
|
Determine the remainder of a division operation. | |
|
Multiply two numbers with optional giving clause. | |
|
Format a numeric string. | |
|
Raise a value to a power. | |
|
Left circular shift an integer. | |
|
Right circular shift an integer. | |
|
Left logical shift an integer. | |
|
Left algebraic shift an integer. | |
|
Right logical shift an integer. | |
|
Right algebraic shift an integer. | |
|
Calculate the sin of a value. | |
|
Calculate the hyperbolic sin of a value. | |
|
Calculate the square root of a value. | |
|
Subtract two numbers with optional giving clause. | |
|
Calculate the tangent of a value. | |
|
Calculate the hyperbolic tangent of a value. |
The arithmetic instructions use the Condition Flags: ZERO, LESS, and OVER. These flags are set or cleared depending on the results of the operation. They usually indicate the following:
|
Flag |
Indication |
|
ZERO |
The result of the instruction was zero. |
|
LESS |
The result of the instruction was less than zero. |
|
OVER |
Significant digits were lost in the result |
When the OVER Condition Flag is set, the LESS and ZERO condition indicators are unpredictable.
![]() |