Bill Allombert on Wed, 3 Nov 1999 10:29:50 +0100 (MET)


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

Re: Bugs... in subresext


Hello,
Using my bug-finder prog, I found:
? 1/(x^5 + 55250567*x - 1)
%1 = 1/(x^5 + 55250567*x - 1)
? Mod(x,1.*(x^3+1))
%2 = Mod(x, 1.000000000000000000000000000*x^3 + 1.000000000000000000000000000)
? %1/%2
  ***   bug in subresext, please report

________________________
A last fix for this week:

? \y
   simplify = 0 (off)
? 0*Qfb(1,2,3)
%1 = 0
? \x
[&=0006a8ec] POL!15000002  7fff0002
-------------^^^-----------^^^^

This patch corrects it.
(CVS updated)
Index: src/basemath/gen1.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/basemath/gen1.c,v
retrieving revision 1.7
diff -u -r1.7 gen1.c
--- src/basemath/gen1.c 1999/11/02 15:12:48     1.7
+++ src/basemath/gen1.c 1999/11/03 09:03:17
@@ -1264,7 +1264,11 @@

   if (vx>vy || (vx==vy && is_scalar_t(tx)))
   {
-    if (isexactzero(x)) return zeropol(vy);
+    if (isexactzero(x))
+    {
+      if (vy == BIGINT) return gzero;/*What else? Bill.*/
+      else return zeropol(vy);
+    }
     if (tx == t_INT && is_pm1(x))
       return (signe(x)>0) ? gcopy(y): gneg(y);
     if (tx == t_POLMOD && vx == vy && ty != t_SER)