HP Fortran Programmer's Reference (September 2007)

Expressions and assignment
Expressions
Chapter 486
subscript, a section subscript with an extent for the upper bound, or a vector subscript.
(Assumed-size arrays are discussed in “Assumed-size arrays” on page 65, and array sections
in “Array sections” on page 68.)
If two operands in an expression are arrays, they must have the same shape. If one operand is
a scalar, it is treated as if it were an array of the same shape as the other operand, in which all
elements have the value of the scalar. The result of the operation is an array in which each
element is the result of applying the operator repeatedly to corresponding elements of the two
operands.
The rules governing how the use of operands in an expression vary, depending on the type of
expression. For example, some operands that may appear on the right-hand side of an
assignment statement but not in an initialization expression. See “Special forms of
expression” on page 92 for detailed information about the different forms of an expression and
the restrictions that those forms impose on operands.
Operators
HP Fortran recognizes the following types of operators:
Arithmetic operators
Relational operators
Concatenation operator
Logical operators
Bitwise operators
Defined operators
All of these except the last are intrinsic operators—that is, the operations they perform are
defined by HP Fortran. Intrinsic operators are described in the following sections. Defined
operators are those that the programmer defines—or overloads, if the operator already has
already been defined—using the INTERFACE statement. Defined operators and overloading are
discussed in “Defined operators” on page 185.
Arithmetic operators
The arithmetic operators are:
Additive operators (+ and -). These can be used either as unary operators or binary
operators.
Multiplicative operators (/, *, and **). These are binary.