FORTRAN Reference Manual

FORTRAN Reference Manual528615-001
3-1
3 Expressions
This section describes the syntax and semantics of FORTRAN expressions. An
expression consists of operands, operators, and parentheses. The evaluation of an
expression yields a single value, whose type is determined by the type of the
operands.
Topics covered in this section include:
A FORTRAN expression is either simple or compound. A simple expression consists of
a single element: a constant, variable, array element, or RECORD field. A compound
expression consists of one or more operands and one or more operators.
FORTRAN recognizes four types of expressions.
Arithmetic
Character
Relational
Logical
FORTRAN also processes constant expressions. A constant expression contains only
constants and symbolic constants. A constant expression can be arithmetic, character,
or logical:
3 + 4 <-- An arithmetic-type expression
'Rip' // 'Van' // 'Winkle' <-- A character-type expression
.TRUE. <-- A logical-type expression
Topic Page
Arithmetic Expressions
3-2
Character Expressions 3-6
Relational Expressions 3-7
Logical Expressions 3-9
Operator Precedence 3-11