Re: bug in x1=Mod(x+X,X^2+1)^2?
Bill Allombert <[email protected]>
| Newsgroups | gmane.comp.mathematics.pari.devel |
|---|---|
| Message-ID | <ZY7lslXiuFKlLn1Z@seventeen> |
On Fri, Dec 29, 2023 at 05:11:47PM +0200, Georgi Guninski wrote: > Is this a bug? > > ? x1=Mod(x+X,X^2+1)^2 > %11 = Mod(1, X^2 + 1)*x^2 + Mod(2*X, X^2 + 1)*x + Mod(-1, X^2 + 1) > ? x2=Mod(X+x,x^2+1)^2 > %12 = Mod(2*X*x + (X^2 - 1), x^2 + 1) > ? norm(x2) > %13 = X^4 + 2*X^2 + 1 > ? norm(x1) > *** at top-level: norm(x1) > *** ^-------- > *** norm: incorrect type in greal/gimag (t_POLMOD). Yes, x1 is a polynomial and not a POLMOD, due to variable priority. This explains why %11 and %12 are displayed differently. Cheers, Bill