Given two numbers, A and B, I am wondering what the most efficient way to determine which of them has more trailing zeros (in binary representation) using Java would be.
I could determine the number of trailing zeros for both of them individually, but I don't know if this is the best approach or if there is some binary magic that could do it better.
Note: the numbers can be very large, I need to use BigInteger.