chiark / gitweb /
math/pfilt.c (pfilt_jump): Fix off-by-one error in reduction.
[catacomb] / math / pfilt.c
index de049cbe02f36c872a4189a0bc637bb6e34e37a7..a4c9856b420224a0a17824afd9478e8f8b8fcadb 100644 (file)
@@ -304,7 +304,7 @@ int pfilt_jump(pfilt *p, const pfilt *j)
 
   for (i = 0; i < NPRIME; i++) {
     p->r[i] = p->r[i] + j->r[i];
-    if (p->r[i] > primetab[i])
+    if (p->r[i] >= primetab[i])
       p->r[i] -= primetab[i];
     if (!p->r[i] && rc == PGEN_TRY) {
       if (MP_LEN(p->m) == 1 && p->m->v[0] == primetab[i])