Operators
Table 9: Arithmetic operators lists the arithmetic operators.
Table 9: Arithmetic operators
Operator Function Usage
^ Exponentiation x = y^2
- Negation x = -2
* Multiplication x% = 2 * 3
/ Division x = 10/2
Mod Modulo x = y Mod z
+ Addition x = 2 + 3
- Subtraction x = 6 - 4
Arithmetic operators follow mathematical rules of precedence.
Note
'+' or '&' can be used for string concatenation.
Table 10: Operator precedence lists the operator precedence from highest to lowest.
Table 10: Operator precedence
Operator Description
() parenthesis (highest precedence)
^ exponentiation
- unary minus
/,* division/multiplication
mod modulo
+, -, & addition, subtraction, concatenation
=, <>, <, >,<=,>= relational
not logical negation
and logical conjunction
or logical disjunction
Xor logical exclusion
Eqv logical Equivalence
Imp logical Implication (lowest precedence)
Table 11: Relational operators lists the relational operators.
Table 11: Relational operators
Operator Function Usage
< Less than x < Y
<= Less than or equal to x <= Y
= Equals x = Y
>= Greater than or equal to x >= Y
> Greater than x > Y
<> Not equal to x <> Y
Table 12: Logical operators lists the logical operators.
Table 12: Logical operators
Operator Function Usage
Not Logical Negation If Not (x)
And Logical And If (x> y) And (x < Z)
Or Logical Or if (x = y) Or (x = z)