Next: Assignment
Up: Expressions and Assignment
Previous: Expressions and Assignment
Each of the three broad type classes
has its own set of intrinsic (in-built) operators,
these are combined with operands to form
expressions. Expressions are made from one operator (eg, +, -,
*,
/, // and **) and at least one operand. Operands
are also expressions.
Expressions have types derived from their operands;
they are either of intrinsic type or a user defined type. For example,
a+6*g(i)/5.0-(a**2) ! numeric
name//" is a wally" ! character
lhs .GT. rhs ! logical
In addition to the intrinsic operations:
- operators may be defined by the user, for example,
.INVERSE.. These defined operators (with 1 or 2 operands) are specified
in a procedure and can be applied to any type or combination of types.
The operator functionality is given in a procedure which must then be
mentioned in an interface block (see Section
).
Such operators are very powerful when used in conjunction with
derived types and modules as a package of objects and operators. - intrinsic operators may be overloaded; when using a derived
type the user can specify exactly what each existing operator means in
the context of this new type.
Next: Assignment
Up: Expressions and Assignment
Previous: Expressions and Assignment
Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996Not for commercial use.