| Operator |
Name |
Result (L is left operand, R is right) |
|
* |
Multiplication |
L × R |
/ |
Division |
L / R |
% |
Modulus |
Remainder of L / R (operands are integers). |
+ |
Addition |
L + R |
- |
Subtraction |
L - R |
< |
Less than |
1 if L < R (or 0 if not). |
> |
Greater than |
1 if L > R (or 0 if not). |
<= |
Less than or equal |
1 if L <= R (or 0 if not). |
>= |
Greater than or equal |
1 if L >= R (or 0 if not). |
== |
Logical equality |
1 if L is equal to R (or 0 if not). |
!= |
Logical inequality |
1 if L is not equal to R (or 0 if it is). |
&& |
Logical and |
1 if both L and R are nonzero, otherwise 0. |
|| |
Logical or |
1 if either L or R are nonzero, otherwise 0. |
<< |
Bitwise left shift |
L shifted left by R bits (both integers). |
>> |
Bitwise right shift |
L shifted right by R bits (both integers). |
& |
Bitwise and |
"Bitwise and" of integers L and R. |
^ |
Bitwise exclusive or |
"Bitwise exclusive or" of integers L and R. |
| |
Bitwise or |
"Bitwise or" of integers L and R. |
| |
Concatenation |
LR |