Jack Fearnley on Fri, 29 Sep 2000 15:25:18 -0400


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

Possible bug in Mod


The following run indicates two problems in Mod. First, when attempting Mod(3,9)) the program does nothing and must be interrupted with <control c>. Second, sqrt(Mod(2,9)) causes the stack to double. Note that this is in version 2.0.17 and may have been corrected by now.

Best Regards,
                Jack Fearnley

                    GP/PARI CALCULATOR Version 2.0.17 (beta)
                i686 running linux (ix86 kernel) 32-bit version
                (readline v4.0 enabled, extended help available)

                           Copyright (C) 1989-1999 by
          C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

   realprecision = 28 significant digits (10 digits displayed)
   seriesprecision = 16 significant terms
   format = g0.10

parisize = 40000000, primelimit = 1000000
? sqrt(Mod(4,3))
%1 = Mod(1, 3)
? sqrt(Mod(3,3))
%2 = Mod(0, 3)
? sqrt(Mod(-3,3))
%3 = Mod(0, 3)
? sqrt(Mod(-3,9))
  ***   user interrupt after 7,340 ms.

? sqrt(Mod(3,9))
  ***   user interrupt after 6,230 ms.

? sqrt(Mod(2,9))
  ***   the PARI stack overflows !!!

  ***   Warning: doubling stack size; new stack = 80000000.
? sqrt(Mod(2,3))
  ***   non quadratic residue in gsqrt
?