Next: Relational Operators
Up: Expressions and Assignment
Previous: Assignment
The following operators are valid for numeric expressions,
- ** exponentiation, dyadic operator, for example,
10**2, (evaluated right to left);
- * and / multiply and divide, dyadic operators, for
example, 10*7/4;
- + and - plus and minus or add and subtract,
monadic
and dyadic operators, for
example, -4 and 7+8-3;
All the above operators can be applied to numeric literals, constants, scalar
and array objects with the only restriction being that the RHS of the
exponentiation operator must be scalar.
Example,
a = b - c
f = -3*6/5
Note that operators have a predefined precedence, which defines the order
that they are evaluated in, (see Section 7.3).
Now try this question
Return to corresponding overview page
Next: Relational Operators
Up: Expressions and Assignment
Previous: Assignment
©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997Not for commercial use.