gcd on polynomials over ZZ [closed]
In Sage 9.4, in the following code:
P.<x> = QQ[]
pol = 2*x^2 + 4*x + 6
print( gcd(pol) )
print( gcd(pol.change_ring(ZZ)) )
The first gcd
works fine, while the second gcd
results in
TypeError: object of type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint' has no len()
There is a workaround by using gcd(pol.coefficients())
, but I wonder if above error is a bug.
PS. This gcd is essentially what is called the content of a polynomial. Surprisingly, .content()
is defined for multivariate polynomials but not for univariate ones.
This smells of an implementation oversight which, IMHO, should be filed as a bug...
It works for me on 9.5.beta4:
That is good to know. Does 9.5 have
.content()
defined for univariate polynomials by any chance?