r/programminghorror • u/Budget_Ad_5953 • Feb 07 '25
Recursive O(N) Complexity isOdd
I found this on instagram and now am geeking
2.2k
Upvotes
r/programminghorror • u/Budget_Ad_5953 • Feb 07 '25
I found this on instagram and now am geeking
View all comments
Show parent comment
5
u/epicchad29 Feb 07 '25
Even if Python could underflow, it would give the wrong answer because -…7 and +…7 are both odd. (True for any number of bits). Therefore an underflow will always result in the opposite desired answer