Previous Topic: Example

Next Topic: Example

Multiply

The *MULT built-in function specifies an arithmetic multiplication of two fields.

The *Rounded field allows you to specify whether the result of the multiplication is to be half-adjusted. Specify the condition *ROUNDED for rounding; specify the condition * for no rounding.

Rounding consists of adding 5 (-5 for a negative result) one position to the right of the last decimal position specified for the length of the result field. As a result, rounding occurs only when the number of decimal positions in the result value exceeds the number of decimal positions in the result field length.

There are four parameters for this function type:

FACTOR1, FACTOR2, and the *Result field must all be numeric.

CA 2E implements the *MULT built-in function as an RPG MULT statement. In COBOL, CA 2E implements the *MULT function as a MULTIPLY statement.