Polynomials in different characteristic can be added #757
Closed
Description
While researching another issue, I stumbled upon this:
gap> t:=Indeterminate(GF(7), "t");;
gap> x:=Indeterminate(Cyclotomics, "x");;
gap> d:=x^2-t+1;
x^2+(-t+Z(7)^0)
gap> Characteristic(d);
0
Oops.
I would have expected a "no method found" error, or even better, an error saying something like "ring elements in different characteristic cannot be added".
Returning a mathematical invalid object is certainly not a good alternative.
It goes on:
gap> Characteristic(d);
0
gap> d + d;
Z(7)^2*x^2+0*Z(7)*x+(Z(7)^5*t+Z(7)^2)
gap> Characteristic(d + d);
0
Finally, trying to compute x/d
seems to lead to an infinite loop (but that is probably fair, the method there receives invalid objects as input