From 29b6e8ff7d305f2635d2782d170d279326eb010b Mon Sep 17 00:00:00 2001 From: Bill Breitmayer Date: Wed, 29 May 2024 11:56:38 -0400 Subject: [PATCH] Fix tabs instead of spaces in comments Fixing tabs instead of spaces in comments --- bit_manipulation/multibit_manipulation.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bit_manipulation/multibit_manipulation.py b/bit_manipulation/multibit_manipulation.py index 470e6033e..3c183f30b 100644 --- a/bit_manipulation/multibit_manipulation.py +++ b/bit_manipulation/multibit_manipulation.py @@ -14,17 +14,18 @@ All parameters must be must be int >= 0, referred to as a 'bit integer'. index:int The offset into the bit position from right, - 0b010111 -> list [1,1,1,0,1,0]. big-endian -> little-endian + 0b010111 -> list [1,1,1,0,1,0]. big-endian -> little-endian For inserts, index is the position to the right of index, - index 0 -> right of rightmost bit. + index 0 -> right of rightmost bit. For gets, sets and removes, it is the position of the bit itself. value:int - Either [0,1] for single bit, or bit mask, bit_length(value) <= bitlen. + Either [0,1] for single bit, or int value for multibit, + bit_length(value) <= bitlen. bitlen:int The effective mask length, spec. leading zeros - ( bitlen 4 value 1 -> 0001 ) + ( bitlen 4 value 1 -> 0001 ) The bitwise expressions may look convoluted, but basically, there are just three parts: left-hand side, value, right-hand side. @@ -230,6 +231,7 @@ def multibit_remove(bint: int, index: int, bit_len: int) -> int: if __name__ == "__main__": + import doctest doctest.testmod()