C++ __builtin_popcount() Function
__builtin_popcount() is a built-in function of GCC compiler. This function is used to count the number of set bits in an unsigned integer.
Parameter: This function only takes unsigned or positive integers as a parameter.
Auxiliary Space: O(1)
Input: n = 4 binary value of 4: 100 Output: 1
What will happen if the data type is of type long long?
__builtin_popcountll is a GCC extension that is used to count the number of set bits in long long data types.
__builtin_popcountll(long long number);
My Personal Notes arrow_drop_up
Please Login to comment...