diff --git a/README.md b/README.md index cb03be1..dbedd7a 100644 --- a/README.md +++ b/README.md @@ -531,9 +531,9 @@ from random import random, randint, choice, shuffle, gauss, seed ### Bitwise Operators ```python - = & # And - = | # Or - = ^ # Xor (0 if both bits equal) + = & # And: `0b1100 & 0b1010 == 0b1000`. + = | # Or: `0b1100 | 0b1010 == 0b1110`. + = ^ # Xor: `0b1100 ^ 0b1010 == 0b0110`. = << n_bits # Left shift (>> for right) = ~ # Not (also: - - 1) ``` diff --git a/index.html b/index.html index fe008bf..5e16413 100644 --- a/index.html +++ b/index.html @@ -633,9 +633,9 @@ to_exclusive = <range>.stop <str> = bin(<int>) # Returns '[-]0b<bin>'. -

Bitwise Operators

<int> = <int> & <int>                    # And
-<int> = <int> | <int>                    # Or
-<int> = <int> ^ <int>                    # Xor (0 if both bits equal)
+

Bitwise Operators

<int> = <int> & <int>                    # And: `0b1100 & 0b1010 == 0b1000`.
+<int> = <int> | <int>                    # Or:  `0b1100 | 0b1010 == 0b1110`.
+<int> = <int> ^ <int>                    # Xor: `0b1100 ^ 0b1010 == 0b0110`.
 <int> = <int> << n_bits                  # Left shift (>> for right)
 <int> = ~<int>                           # Not (also: -<int> - 1)