Single Mode Arithmetic Expressions


An arithmetic expression is an expression using additions +, subtractions -, multiplications *, divisions /, and exponentials **. A single mode arithmetic expression is an expression all of whose operands are of the same type (i.e. INTEGER, REAL or COMPLEX). However, only INTEGER and REAL will be covered in this note. Therefore, those values or variables in a single mode arithmetic expression are all integers or real numbers.

In single mode arithmetic expressions, the result of an operation is identical to that of the operands. The following is a table showing this fact. The empty entries will be discussed in mixed mode arithmetic expressions.

Operator INTEGER REAL
INTEGER INTEGER mixed mode
REAL mixed mode REAL

Simple Examples:

Rules for Evaluating Expressions

The following are rules of evaluating a more complicated single mode arithmetic expression:

More Complicated Examples:

In the following examples, brackets are used to indicated the order of evaluation.

Click here to continue with mixed mode arithmetic expressions.