diff --git a/README.md b/README.md index 8790adc..54d7569 100644 --- a/README.md +++ b/README.md @@ -445,7 +445,17 @@ shuffle() = 0b # Or: 0x = int('0b', 0) # Or: int('0x', 0) = int('', 2) # Or: int('', 16) -'0b' = bin() # Or: '0x' = hex() +'0b' = bin() # Or: '0x' = hex() +``` + +### Bitwise Operators +```python + = & # And + = | # Or + = ^ # Xor (0 if both bits equal) + = << n_bits # Shift left + = >> n_bits # Shift right + = ~ # Compliment (flips bits) ``` diff --git a/index.html b/index.html index e095399..59d5298 100644 --- a/index.html +++ b/index.html @@ -504,7 +504,15 @@ shuffle(<list>)
<int>     = 0b<bin>            # Or: 0x<hex>
 <int>     = int('0b<bin>', 0)  # Or: int('0x<hex>', 0)
 <int>     = int('<bin>', 2)    # Or: int('<hex>', 16)
-'0b<bin>' = bin(<int>)         # Or: '0x<bin>' = hex(<int>)
+'0b<bin>' = bin(<int>)         # Or: '0x<hex>' = hex(<int>)
+
+

Bitwise Operators

+
<int>     = <int> & <int>      # And
+<int>     = <int> | <int>      # Or
+<int>     = <int> ^ <int>      # Xor (0 if both bits equal)
+<int>     = <int> << n_bits    # Shift left
+<int>     = <int> >> n_bits    # Shift right
+<int>     = ~<int>             # Compliment (flips bits)
 

#Combinatorics