3 ms·
In 2012, using bit shifting in your code for multiplication or division by powers of 2 is a bad idea. It makes the intent of your code less obvious and it's not
by DrJokepu 14y ago
In 2012, using bit shifting in your code for multiplication or division by powers of 2 is a bad idea. It makes the intent of your code less obvious and it's not always safe (think 2's complement negative numbers). The compiler or the JITter will make this optimization for you when it's appropriate.