Bit Tricks · x & (x-1) · x & -x · popcount
unseel.com · clear lowest bit · isolate lowest bit · Hamming weight
x 12
popcount 2
Trick
Bit = 0
Bit = 1
Bit cleared this step
Bit isolated
Unseel.com · Bit Tricks