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

Procedure Division
HP COBOL Manual for TNS/E Programs520347-003
8-46
Arithmetic Expressions
Arithmetic expressions can appear in:
ENTER statements
EVALUATE statements
Reference modifiers
Sign conditions
Relation conditions
Function arguments
The values computed when arithmetic expressions are evaluated are transitory and
are not stored for later use by the program.
Topics:
Operands
Arithmetic Operators
Formation and Evaluation Rules
Operands
An operand is a numeric literal, the identifier of a numeric data item, or any arithmetic
expression enclosed within balanced left and right parentheses. The identifiers and
literals appearing in an arithmetic expression must represent numeric data items and
numeric literals upon which arithmetic can be performed.
Arithmetic Operators
Each operator in Table 8-13 must be preceded and followed by a separator (usually
spaces or parentheses).
The minus sign (-) and the plus sign (+) must be preceded by a space or a left
parenthesis and followed by a space. The exponentiation sign (**) cannot contain an
embedded space, but it can be split across two lines through the use of the hyphen
continuation character.
Table 8-13. Arithmetic Operators
Operator
MeaningSymbol Kind
+ Unary Multiplication by +1
Binary Addition
- Unary Multiplication by -1
Binary Subtraction
* Binary Multiplication
/ Binary Division
** Binary Exponentiation