Bill Allombert on Sun, 1 Jun 2003 00:16:33 +0200


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

Re: galoisinit() bug


On Thu, May 29, 2003 at 02:23:48PM -0400, Igor Schein wrote:
> Hi,
> ? galoisinit(p);
>   ***   impossible inverse modulo: Mod(2, 30).

Well, the patch below fix this.

Now I am not yet sure it is correct, could you check
it does not break with other polynomials ?

Cheers,
Bill.

Index: src/basemath/galconj.c
===================================================================
RCS file: /home/megrez/cvsroot/pari/src/basemath/galconj.c,v
retrieving revision 1.116
diff -u -r1.116 galconj.c
--- src/basemath/galconj.c	2003/04/23 09:55:07	1.116
+++ src/basemath/galconj.c	2003/05/31 21:59:17
@@ -2592,10 +2592,10 @@
   else
   {
     /*We need to normalise result so that psi[g]=1*/
-    long im=itos(mpinvmod(stoi(gf->psi[g]),stoi(gf->fp)));
+    long im=itos(mpinvmod(stoi(gf->psi[g]),stoi(deg)));
     GEN cp=perm_pow(res, im);
     for(i=1;i<lg(res);i++) res[i]=cp[i];
-    for(i=1;i<lg(gf->psi);i++) gf->psi[i]=mulssmod(im,gf->psi[i],gf->fp);
+    for(i=1;i<lg(gf->psi);i++) gf->psi[i]=mulssmod(im,gf->psi[i],deg);
     avma=av2;
     gf->deg=deg;
     return res;