(num)
return ret
Find the highest bit set to 0 in an integer.
Find the highest bit set to 0 in an integer.
Find the highest bit set to 0 in an integer .
def _count0Bits(num):
    """Find the highest bit set to 0 in an integer."""

    # this could be so easy if _count1Bits(~int(num)) would work as excepted
    num = int(num)
    if num < 0:
        raise ValueError("Only positive Numbers please: %s" % (num))
    ret = 0
    while num > 0:
        if num & 1 == 1:
            break
        num = num >> 1
        ret += 1
    return ret
def _count0Bits ( num ) : # this could be so easy if _count1Bits(~int(num)) would work as excepted num = int ( num ) if num < 0 : raise ValueError ( "Only positive Numbers please: %s" % ( num ) ) ret = 0 while num > 0 : if num & 1 == 1 : break num = num >> 1 ret += 1 return ret