On 2012-04-14 16:21, John Cremona wrote:
> This issue comes up periodically, but no-one (as far as I know) has
> come up with  a good algorithm.  The obvious one here is what you get
> if you work in the fraction field of Z[X] instead of Q[X].  Are there
> other special cases which should be handled apart from coefficient
> rings which are fields of fractions of PIDs or UFDs?

How about dividing by the gcd() of all coefficients:

sage: R.<x> = QQ[]
sage: pol1=R(2)
sage: pol2=2*x
sage: gcd(pol1.list() + pol2.list())
2

With weird base rings, this might raise an exception, in which case we
don't do anything special.

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to