In C++20, to remove trailing zeros in the binary representation of an integer you can use a >>= std::countr_zero(a);
.
I think it is optimized by the compiler so very fast.
What would be the C equivalent, is there a faster way to do it than a while loop?
while ((a & 1) == 0) { a >> 1; }