Skip to content

Commit ab46f71

Browse files
Update bitmasking.md
1 parent 47a86e7 commit ab46f71

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Diff for: bitmasking.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
Bitmasking involves using bitwise operators to manipulate individual bits within an integer. This technique is useful for various tasks like toggling, setting, clearing bits, and checking their status. Understanding bitwise operations is crucial for efficient low-level data manipulation.
44

55

6-
Bitwise operations involve operations between two bits. Below is a table showing all possible combinations for AND, OR, and XOR operations.
6+
*Bitwise operations involve operations between two bits. Below is a table showing all possible combinations for AND, OR, and XOR operations.
77

8+
| A | B | A & B | A | B | A ^ B |
9+
|---|---|---------|--------|---------|
10+
| 0 | 0 | 0 | 0 | 0 |
11+
| 0 | 1 | 0 | 1 | 1 |
12+
| 1 | 0 | 0 | 1 | 1 |
13+
| 1 | 1 | 1 | 1 | 0 |
814

9-
10-
| A | B | | A & B | A | B | A ^ B |
11-
|---|---| |---------|--------|---------|
12-
| 0 | 0 | | 0 | 0 | 0 |
13-
| 0 | 1 | | 0 | 1 | 1 |
14-
| 1 | 0 | | 0 | 1 | 1 |
15-
| 1 | 1 | | 1 | 1 | 0 |
16-
*AND (&) , OR (|) , XOR (^)
17-
15+
AND (&) , OR (|) , XOR (^)
16+
##
1817

1918
## Bitwise Operators in Python
2019

0 commit comments

Comments
 (0)