3 ms·
Division by 2 is one of the quickest operation. The correct implies 3 additions instead of one, so you go a point. But y>>1 + x>>1 + (x & y & 1) is easier to
by _ache_ 4y ago
Division by 2 is one of the quickest operation.
The correct implies 3 additions instead of one, so you go a point.
But y>>1 + x>>1 + (x & y & 1) is easier to remember than ((x^y)>>1) + (x&y).