The arithmetic operations are shown in the following table.
Operation | Traditional Syntax | Free-Form Syntax |
---|---|---|
Absolute Value | %ABS (Absolute Value of Expression) | |
Add | ADD (Add) | + operator |
Divide | DIV (Divide) | / operator or %DIV (Return Integer Portion of Quotient) |
Division Remainder | MVR (Move Remainder) | %REM (Return Integer Remainder) |
Multiply | MULT (Multiply) | * operator |
Square Root | SQRT (Square Root) | %SQRT (Square Root of Expression) |
Subtract | SUB (Subtract) | - operator |
Zero and Add | Z-ADD (Zero and Add) | (not allowed) |
Zero and Subtract | Z-SUB (Zero and Subtract) | (not allowed) |
For examples of arithmetic operations, see Figure 1.
However, the DIV operation uses either the packed-decimal or float format for its operations. For more information on integer and unsigned arithmetic, see Integer and Unsigned Arithmetic.