$ 0 0 Here's a simple C++ solution:bool IsPowerOfTwo( unsigned int i ){ return std::bitset<32>(i).count() == 1;}