def dmp_ground_primitive(f, u, K):
 if (not u):
  return dup_primitive(f, K)
 if dmp_zero_p(f, u):
  return (K.zero, f)
 cont = dmp_ground_content(f, u, K)
 if K.is_one(cont):
  return (cont, f)
 else:
  return (cont, dmp_quo_ground(f, cont, u, K))

def dmp_ground_primitive ( f , u , K ) : if ( not u ) : return dup_primitive ( f , K ) if dmp_zero_p ( f , u ) : return ( K . zero , f ) cont = dmp_ground_content ( f , u , K ) if K . is_one ( cont ) : return ( cont , f ) else : return ( cont , dmp_quo_ground ( f , cont , u , K ) )
compute content and the primitive form of f in k[x] .