That’s a platform dependent change. Overflow is undefined behavior. I’d rather have my code portable so it can run on my Univac 1101.
- 0 Posts
- 3 Comments
Joined 2 years ago
Cake day: July 1st, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
Fixed
boolean isOdd(int num) { if(num == 1) return true; if(num > 0) return isEven(num - 1); else return isEven(num + 1); } boolean isEven(int num) { if(num > 0) return isOdd(num - 1); else return isOdd(num + 1); }
What can I say, I’m a performance nerd.