Operators

The following table shows the operators for the SPEL+ language.

Keyword or Symbol Example Description
+ A+B Addition
- A-B Subtraction
* A*B Multiplication
/ A/B Division
** A**B Exponentiation
= A=B Equal
> A>B Greater than
< A<B Less than
>= A>=B Greater than or equal
<= A<=B Less or than equal
<> A<>B Not equal
And A And B Performs logical and bitwise AND operation.
Mod A Mod B Returns the remainder obtained by dividing a numeric expression by another numeric expression.
Not Not A Performs logical or bitwise negation of the operand.
Or A Or B Performs the bitwise Or operation on the values of the operands.
Xor A Xor B Performs the bitwise Xor operation on the values of the operand.

Priority Order of the Operators

The operators are processed in programs in the following order.

Priority level Operator Example Description
1 () ( A+B ) Brackets
2 ** A**B Exponentiation
3 * A*B Multiplication
/ A/B Division
4 Mod A Mod B Returns the remainder obtained by dividing a numeric expression by another numeric expression.
5 + A+B Addition
- A-B Subtraction
6 = A=B Equal
<> A<>B Not equal
< A<B Less than
> A>B Greater than
<= A<=B Less or than equal
>= A>=B Greater than or equal
7 Not Not A Performs logical or bitwise negation of the operand.
8 And A And B Performs logical and bitwise AND operation.
9 Or A Or B Performs the bitwise Or operation on the values of the operands.
10 Xor A Xor B Performs the bitwise Xor operation on the values of the operand.