3 ms·
Right. And the reason that zeroes out the least significant bit is because subtracting one just borrows up to it. E.g., for n = 464: n = 464d 11101
by a_e_k 4y ago
Right. And the reason that zeroes out the least significant bit is because subtracting one just borrows up to it. E.g., for n = 464:
n = 464d 111010000b
n-1 = 463d 111001111b
n&(n-1) = 448d 111000000b