Hello, 2015-01-26 14:22 UTC+01:00, Bruno Grenet <bruno.gre...@gmail.com>: > In the special case of univariate polynomials over ZZ, I think there are > two possibilities for xgcd: > > - either xgcd(p,q) = (g,u,v) where g = gcd(p,q) = up+vq with u,v in QQ[x]; > - or xgcd(p,q) = (g×r, u, v) where g = gcd(p,q), r = res(p,q), g×r = > up+vq with u,v in ZZ[x].
Note that this second solution is precisely what we have in Sage right now {{{ sage: x = polygen(ZZ) sage: (x+2).xgcd(x+4) (2, -1, 1) }}} Only the function `xgcd` is badly documented not the method of polynomials. (And in the case when p and q are coprime over QQ, the first term obtained from xgcd is the resultant.) > More generally, Bézout coefficients seem to be usually defined only for > PID, and this motivates the first solution (in general, replace ZZ by a > UFD R and QQ by its field of fractions K). The second solution has the > advantage of staying in the same polynomial ring, and it has a clear > definition. I would go for the second solution, with an updated > documentation. Do you know in which context this second definition of Bézout coefficients make sense? I guess we need the fraction field to be a PID (or more generally a Bézout ring). I am not tempted with a version of xgcd that has its member in another ring... but for mysterious backward compatibility reasons we also have {{{ sage: gcd(3.0, 6.0) 3 sage: gcd(3.0, 6.0).parent() Integer Ring }}} And I would like the above behavior to be modified within #17671. Vincent -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.