@@ -8,8 +8,8 @@ def set_bit(number: int, position: int) -> int:
88 Set the bit at position to 1.
99
1010 Details: perform bitwise or for given number and X.
11- Where X is a number with all the bits – zeroes and bit on given
12- position – one.
11+ Where X is a number with all the bits - zeroes and bit on given
12+ position - one.
1313
1414 >>> set_bit(0b1101, 1) # 0b1111
1515 15
@@ -26,8 +26,8 @@ def clear_bit(number: int, position: int) -> int:
2626 Set the bit at position to 0.
2727
2828 Details: perform bitwise and for given number and X.
29- Where X is a number with all the bits – ones and bit on given
30- position – zero.
29+ Where X is a number with all the bits - ones and bit on given
30+ position - zero.
3131
3232 >>> clear_bit(0b10010, 1) # 0b10000
3333 16
@@ -42,8 +42,8 @@ def flip_bit(number: int, position: int) -> int:
4242 Flip the bit at position.
4343
4444 Details: perform bitwise xor for given number and X.
45- Where X is a number with all the bits – zeroes and bit on given
46- position – one.
45+ Where X is a number with all the bits - zeroes and bit on given
46+ position - one.
4747
4848 >>> flip_bit(0b101, 1) # 0b111
4949 7
@@ -79,7 +79,7 @@ def get_bit(number: int, position: int) -> int:
7979 Get the bit at the given position
8080
8181 Details: perform bitwise and for the given number and X,
82- Where X is a number with all the bits – zeroes and bit on given position – one.
82+ Where X is a number with all the bits - zeroes and bit on given position - one.
8383 If the result is not equal to 0, then the bit on the given position is 1, else 0.
8484
8585 >>> get_bit(0b1010, 0)
0 commit comments