def dup_clear_denoms(f, K0, K1=None, convert=False):
 if (K1 is None):
  if K0.has_assoc_Ring:
   K1 = K0.get_ring()
  else:
   K1 = K0
 common = K1.one
 for c in f:
  common = K1.lcm(common, K0.denom(c))
 if (not K1.is_one(common)):
  f = dup_mul_ground(f, common, K0)
 if (not convert):
  return (common, f)
 else:
  return (common, dup_convert(f, K0, K1))

def dup_clear_denoms ( f , K0 , K1 = None , convert = False ) : if ( K1 is None ) : if K0 . has_assoc_Ring : K1 = K0 . get_ring ( ) else : K1 = K0 common = K1 . one for c in f : common = K1 . lcm ( common , K0 . denom ( c ) ) if ( not K1 . is_one ( common ) ) : f = dup_mul_ground ( f , common , K0 ) if ( not convert ) : return ( common , f ) else : return ( common , dup_convert ( f , K0 , K1 ) )
clear denominators .