Commit f733750
deepshekhardas
fix: raise ValueError for zero input in binary_count_trailing_zeros
binary_count_trailing_zeros(0) returned 0 but trailing zeros for
zero are mathematically undefined. Raise ValueError with message
"Input value must be a positive integer" instead, matching the
behavior for negative inputs. Update doctest and reorder type
checks to validate float before range check.
Fixes #144791 parent f5988cc commit f733750
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
0 commit comments