def bitcount(num):
 num = (num - ((num >> 1) & 6148914691236517205))
 num = ((num & 3689348814741910323) + ((num >> 2) & 3689348814741910323))
 num = ((num + (num >> 4)) & 1085102592571150095)
 return int(((num * 72340172838076673) >> 56))

def bitcount ( num ) : num = ( num - ( ( num >> 1 ) & 6148914691236517205 ) ) num = ( ( num & 3689348814741910323 ) + ( ( num >> 2 ) & 3689348814741910323 ) ) num = ( ( num + ( num >> 4 ) ) & 1085102592571150095 ) return int ( ( ( num * 72340172838076673 ) >> 56 ) )
count the number of bits in a numeric value .