(s, n, prec, rnd=round_fast)
return normalize(sign, man, exp, bc, prec, rnd)
Multiply by a Python integer.
Multiply by a Python integer.
Multiply by a Python integer .
def python_mpf_mul_int(s, n, prec, rnd=round_fast):
    """Multiply by a Python integer."""
    sign, man, exp, bc = s
    if not man:
        return mpf_mul(s, from_int(n), prec, rnd)
    if not n:
        return fzero
    if n < 0:
        sign ^= 1
        n = -n
    man *= n
    # Generally n will be small
    if n < 1024:
        bc += bctable[int(n)] - 1
    else:
        bc += bitcount(n) - 1
    bc += int(man>>bc)
    return normalize(sign, man, exp, bc, prec, rnd)
def python_mpf_mul_int ( s , n , prec , rnd = round_fast ) : sign , man , exp , bc = s if not man : return mpf_mul ( s , from_int ( n ) , prec , rnd ) if not n : return fzero if n < 0 : sign ^= 1 n = - n man *= n # Generally n will be small if n < 1024 : bc += bctable [ int ( n ) ] - 1 else : bc += bitcount ( n ) - 1 bc += int ( man >> bc ) return normalize ( sign , man , exp , bc , prec , rnd )