Bitwise and Shift Operators
Get introduced to bitwise and shift operators in Dart.
We'll cover the following
Types of bitwise and shift operators
Bitwise operators and shift operators are operators that perform operations on individual bits of integer types. Below is a list of the bitwise operators supported by Dart.
Operator | Name | Use |
---|---|---|
& |
Bitwise AND | If the corresponding bit in both operands is 1 it will give a 1, else 0 |
| |
Bitwise OR | If the corresponding bit in at least one operand is 1 it will give a 1, else 0 |
^ |
Bitwise XOR | If the corresponding bit in only one operand is 1 it will give a 1, else 0 |
~ |
Unary Bitwise Complement | Bits which are 0 become 1 and bits which are 1 become 0 |
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy