Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
int count_bits(int n)
{
int sum;
sum=(n>>1)&03333333333;
sum=n-sum-((sum>>1)&03333333333);
sum=((sum+(sum>>3))&0707070707)%077;
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment