Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Operators

Avelino edited this page Dec 24, 2017 · 4 revisions
Operator Description Example Functional description Implemented?
+ addition yes
- subtraction yes
* multiplication yes
** exponentiation yes
/ quotient yes
% remainder yes
& bitwise and yes
| bitwise or yes
^ bitwise xor yes
<< left shift yes
>> right shift yes
== equal yes
!= not equal yes
< less than yes
<= less than or equal yes
> greater than yes
>= greater than or equal yes
&& logical and yes
|| logical or yes
! logical not yes
+= Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand (+= C A) C = C + A no
-= Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand (-= C A) C = C - A no
*= Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand (*= C A) C = C * A no
/= Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand (/= C A) C = C / A no
%= Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand (%= C A) C = C % A no
<<= Left shift AND assignment operator (<<= C 2) C = C << 2 no
>>= Right shift AND assignment operator (>>= C 2) C = C >> 2 no
&= Bitwise AND assignment operator (&= C 2) C = C & 2 no
^= bitwise exclusive OR and assignment operator (^= C 2) C = C ^ 2 no
|= bitwise inclusive OR and assignment operator (|= C 2) C = C | 2 no

Would you like to propose more operators? https://github.com/rumlang/rum/issues/60

Clone this wiki locally