3 ms·
The whole ONES... HASZERO shenanigans is somewhat explained here: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord https://graphics.stanford.edu/
by Kristine1975 10y ago
The whole ONES... HASZERO shenanigans is somewhat explained here: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW... as well as the entry after it.
Edit: And most likely in the excellent book "Hacker's Delight" as well.