Table of Contents
# Arithmetic Operators
+ | Add |
- | Subtract |
-expr | Unary minus, also known as negation (reverse the sign of the expression) |
* | Multiply |
/ | Divide |
~/ | Divide, returning an integer result |
% | Get the remainder of an integer division (modulo) |
++ | Increment |
-- | Decrement |
# Equality and Relational Operators
< | A Lesser than B | (A < B) is True |
>= | A Greater than or equal to B | (A >= B) is False |
<= | A Lesser than or equal to B | (A <= B) is True |
== | A Equality B | (A==B) is False |
!= | A Not equal B | (A!=B) is True |
# Type test Operators
is | True if the object has the specified type |
is! | False if the object has the specified type |
Bitwise AND | a & b |
Bitwise OR | a | b |
Bitwise XOR | a ^ b |
Bitwise NOT | ~ a |
| Left shift | a ≪ b |
| Signpropagating right shift | a ≫ b |
# Assignment Operators
=(Simple Assignment ) | Assigns values from the right side operand to the left side operand Ex:C = A + B will assign the value of A + B into C |
??= | Assign the value only if the variable is null |
+=(Add and Assignment) | It adds the right operand to the left operand and assigns the result to the left operand. Ex: C += A is equivalent to C = C + A |
-=(Subtract and Assignment) | It subtracts the right operand from the left operand and assigns the result to the left operand. Ex: C -= A is equivalent to C = C – A |
*=(Multiply and Assignment) | It multiplies the right operand with the left operand and assigns the result to the left operand. Ex: C *= A is equivalent to C = C * A |
/=(Divide and Assignment) | It divides the left operand with the right operand and assigns the result to the left operand. |
# Logical Operators
&& | And − The operator returns true only if all the expressions specified return true |
|| | OR − The operator returns true if at least one of the expressions specified return true |
! | NOT − The operator returns the inverse of the expression’s result. |