Let us start simple. Say you want to find how many 1\'s in a long in its binary representation. For example, how many 1\'s in 228₁₀? The binary represenation is
long