There is a fast way to do the divide by two, looking at the bits.