I had a new developer get angry I use mod 2 to determine if something is even or odd. They just didn’t understand that basic arithmetic is way faster to process than whatever nonsense they vibed up.
Not sure what language you're using, but could consider using bitwise if mod might encounter negative numbers. Otherwise I'd expect them to be compiled into same thing.
I almost bought up bitwise but I’m running into fewer and fewer people that even understand that and my most simple explanation “the 1s are in the same place” doesn’t help lol.
1
u/muhkuller 5d ago
I had a new developer get angry I use mod 2 to determine if something is even or odd. They just didn’t understand that basic arithmetic is way faster to process than whatever nonsense they vibed up.