def term_div(a, b, domain):
 (a_lm, a_lc) = a
 (b_lm, b_lc) = b
 monom = monomial_div(a_lm, b_lm)
 if domain.has_Field:
  if (monom is not None):
   return (monom, domain.quo(a_lc, b_lc))
  else:
   return None
 elif (not ((monom is None) or (a_lc % b_lc))):
  return (monom, domain.quo(a_lc, b_lc))
 else:
  return None

def term_div ( a , b , domain ) : ( a_lm , a_lc ) = a ( b_lm , b_lc ) = b monom = monomial_div ( a_lm , b_lm ) if domain . has_Field : if ( monom is not None ) : return ( monom , domain . quo ( a_lc , b_lc ) ) else : return None elif ( not ( ( monom is None ) or ( a_lc % b_lc ) ) ) : return ( monom , domain . quo ( a_lc , b_lc ) ) else : return None
division of two terms in over a ring/field .