COBOL Manual for TNS/E Programs (H06.03+)

Procedure Division
HP COBOL Manual for TNS/E Programs520347-003
8-43
Arithmetic Operations
Arithmetic Operations
Many different statements tell the compiler to perform arithmetic operations, either
because they are arithmetic statements or because they include arithmetic
expressions.
The arithmetic statements are:
ADD
COMPUTE
DIVIDE
MULTIPLY
SUBTRACT
Topics:
Common Features of Arithmetic Statements
Arithmetic Expressions
Arithmetic Precision
Common Features of Arithmetic Statements
This section describes the common features of the arithmetic statements, which are:
Data Conversion and Alignment
Composite of Operands
Intermediate Data Items
Multiple Results
Incompatible Data
Data Conversion and Alignment
The data descriptions of the operands need not be the same; any necessary
conversion and decimal point alignment is supplied by the COBOL compiler throughout
the calculation.
Composite of Operands
The maximum size of each arithmetic operand is 18 decimal digits, independent of any
decimal point. When the computer performs arithmetic, it must handle operands of
different data descriptions. To discuss the restrictions on arithmetic operations, the
COBOL community coined the term “composite of operands.”