$ 0 0 What aboutint highest_bit(unsigned int a) { int count; std::frexp(a, &count); return count - 1;}?