Arithmetic/Logic Operators
Operator |
Operation |
Input Types 1) |
Result Types 1) |
+ |
addition |
integer, real |
integer, real |
- |
subtraction |
integer, real |
integer, real |
* |
multiplication |
integer, real |
integer, real |
/ |
division |
integer, real |
real |
= |
equal |
integer, real, boolean |
boolean |
<> |
not equal |
integer, real, boolean |
boolean |
< |
less than |
integer, real |
boolean |
<= |
less equal |
integer, real |
boolean |
> |
greater |
integer, real |
boolean |
>= |
greater equal |
integer, real |
boolean |
shl |
shift left of integer variables (= multiply by 2) |
integer |
integer |
shr |
shift right of integer variables (= divide by 2) |
integer |
integer |
div |
integer division |
integer |
integer |
mod |
remainder of an integer division |
integer |
integer |
not |
negation |
boolean |
boolean |
and |
logic AND |
boolean |
boolean |
or |
logic OR |
boolean |
boolean |
xor |
exclusive OR |
boolean |
boolean |
Hint: |
The plus operator (+) has a second meaning for strings: it concatenates two strings to form a single one. |
|