From 4c3bfcd01c3ac16ddca53eb1f0d87195bd17487a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 3 Mar 2022 15:17:22 +0100 Subject: [PATCH] Bitwise operators --- README.md | 10 +++++----- index.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4bbd39c..d8709b6 100644 --- a/README.md +++ b/README.md @@ -533,11 +533,11 @@ from random import random, randint, choice, shuffle, gauss, seed ### Bitwise Operators ```python - = & # And: `0b1100 & 0b1010 == 0b1000`. - = | # Or: `0b1100 | 0b1010 == 0b1110`. - = ^ # Xor: `0b1100 ^ 0b1010 == 0b0110`. - = << n_bits # Left shift (>> for right) - = ~ # Not (also: - - 1) + = & # 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 1a8c61b..08b9d0a 100644 --- a/index.html +++ b/index.html @@ -482,11 +482,11 @@ to_exclusive = <range>.stop <str> = bin(<int>) # Returns '[-]0b<bin>'. -

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)
+

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).
 

#Combinatorics