We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent dde1fa3 commit b52bde6Copy full SHA for b52bde6
bit_manipulation/index_of_rightmost_set_bit.py
@@ -20,7 +20,7 @@ def get_index_of_rightmost_set_bit(number: int) -> int:
20
ValueError: Input must be a non-negative integer
21
"""
22
23
- if 0 > number and not isinstance(number, int):
+ if number<0 or not isinstance(number, int):
24
raise ValueError("Input must be a non-negative integer")
25
26
intermediate = number&~(number-1)
@@ -38,4 +38,4 @@ def get_index_of_rightmost_set_bit(number: int) -> int:
38
39
import doctest
40
41
- doctest.testmod()
+ doctest.testmod(verbose=True)
0 commit comments