8 ms·
Don't the two bits of code have completely different behaviour? And the code with the bitshift is undefined on negative integers (in C). So the bottom code coul
by sammoth 9y ago
Don't the two bits of code have completely different behaviour? And the code with the bitshift is undefined on negative integers (in C). So the bottom code could indeed be the "correct way to do it".
- biesnecker 9y agoFair, with negative ints they're different. They have the same behavior on positive ints, though.