Karim BELABAS on Wed, 9 Dec 1998 14:39:09 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: bug with complex coefficient polynomials


[Igor:]
> No, it doesn't look bizarre, but rather like a pretty trivial bug now, because:
> 
> ? factor(polcyclo(10)+I*polcyclo(15))
> 
> [x^8 - x^7 + x^5 + (-1 - I)*x^4 + (1 + I)*x^3 - I*x^2 + (-1 + I)*x + (1 - I) 0]
> 
> The degree of the factor is reported as 0, so no wonder it factors back to 1

Indeed, here's a patch.

  Karim.

*** src/basemath/polarit2.c.orig        Wed Dec  9 13:24:20 1998
--- src/basemath/polarit2.c     Wed Dec  9 14:35:07 1998
***************
*** 787,793 ****
  {
    GEN x = cgetg(4,t_POL);
    x[1] = evalsigne(1) | evalvarn(v) | evallgef(4);
!   x[2] = (long)x0; x[3] = (long)x1; return x;
  }
  
  GEN
--- 787,793 ----
  {
    GEN x = cgetg(4,t_POL);
    x[1] = evalsigne(1) | evalvarn(v) | evallgef(4);
!   x[2] = (long)x0; x[3] = (long)x1; return normalizepol(x);
  }
  
  GEN
--
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://pari.home.ml.org