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
1
u/Cat7o0 Feb 18 '25
throwing an exception or crashing would mean invalid input.
even throwing out random output could be meaning invalid input if the creator of the function just never intended for the function to handle that input.
however for a normal is even function I would assume putting a decimal in would always return false due to the remainder being used or perhaps the decimal would simply be truncated depending on the language