Mark Chimley on Thu, 14 Mar 2002 21:57:12 +0000 (GMT)

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

isprime functions

I have been trying to do some simple verifications of "primeness" using
the functions long isprime (GEN x) and GEN gisprime (GEN X, long flag)
under PARI 2.1.0. I am having a lot of problems. I started with the
simpler function, isprime, but this regularly reported "division by zero
in dvmdii" for randomly selected integers. With these problems I tried
gisprime (X, 1), which uses the Lucas-Lehmer test instead of M-R.
However, this appeared to cause random problems with gadd (I was adding
two in a loop until a number passed gisprime). The errors with gadd
ranged from segmentation faults to "forbidden *** unknown type n", where
n ranged from 30 to 200 or so.

Due to the random nature of these errors, it would seem less likely that
the problem is with the code surrounding the loop (i.e. user error with
the PARI stack!), although obviously this cannot be ruled out. It would
also seem unlikely that there is a problem with such fundamental

Any help in determining the cause of these problems would be gratefully


Mark Chimley,
Department Of Mathematics,
University Of Bristol