13 ms·
Algebraically, where | denotes concatenation, and z is a string of 0s: x = y | 1 | z -x = ~x + 1 -x = (~y | 0 | ~z) + 1 -x = ~y | 1 | z x & -x = (y & ~y) |
by StevenXC 2y ago
Algebraically, where | denotes concatenation, and z is a string of 0s:
x = y | 1 | z
-x = ~x + 1
-x = (~y | 0 | ~z) + 1
-x = ~y | 1 | z
x & -x = (y & ~y) | (1 & 1) | (z & z)
x & -x = 0 | 1 | z