59 assert(bit_manipulation::count_of_set_bits::countSetBits(4) == 1);
61 assert(bit_manipulation::count_of_set_bits::countSetBits(6) == 2);
63 assert(bit_manipulation::count_of_set_bits::countSetBits(13) == 3);
65 assert(bit_manipulation::count_of_set_bits::countSetBits(9) == 2);
67 assert(bit_manipulation::count_of_set_bits::countSetBits(15) == 4);
69 assert(bit_manipulation::count_of_set_bits::countSetBits(25) == 3);
71 assert(bit_manipulation::count_of_set_bits::countSetBits(97) == 3);
73 assert(bit_manipulation::count_of_set_bits::countSetBits(31) == 5);
74 std::cout <<
"All test cases successfully passed!" << std::endl;
std::uint64_t countSetBits(std ::int64_t n)
The main function implements set bit count.
Functions for the count sets bits implementation.