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,
-
NumBabiesBorn+1
-- numeric valued -
"Ward "//Ward
-- character valued -
TimeSinceLastBirth .GT. MaxTimeTwixtBirths
--
logical valued
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.
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.
Return to corresponding overview page
Next: Assignment
Up: Expressions and Assignment
Previous: Expressions and Assignment
©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997Not for commercial use.