def dmp_rr_lcm(f, g, u, K):
 (fc, f) = dmp_ground_primitive(f, u, K)
 (gc, g) = dmp_ground_primitive(g, u, K)
 c = K.lcm(fc, gc)
 h = dmp_quo(dmp_mul(f, g, u, K), dmp_gcd(f, g, u, K), u, K)
 return dmp_mul_ground(h, c, u, K)

def dmp_rr_lcm ( f , g , u , K ) : ( fc , f ) = dmp_ground_primitive ( f , u , K ) ( gc , g ) = dmp_ground_primitive ( g , u , K ) c = K . lcm ( fc , gc ) h = dmp_quo ( dmp_mul ( f , g , u , K ) , dmp_gcd ( f , g , u , K ) , u , K ) return dmp_mul_ground ( h , c , u , K )
computes polynomial lcm over a ring in k[x] .