/* a and b must be t_INTs, code must be a t_CLOSURE. */
static int
forfactoredss(long a, long b, GEN code)
{
pari_sp av = avma;
int br = 0;
GEN f = gnil;
long n;
push_lex(f,code);
for (n = a; n <= b; n++) {
f = Z_factor(stoi(n));
set_lex(-1, f);
closure_evalvoid(code);
if (loop_break()) {
pop_lex(1);
br = 1;
break;
}
if (get_lex(-1) != f)
pari_err(e_MISC, "factors read-only: was changed to %Ps", get_lex(-1));
}
pop_lex(1);
avma = av;
return br;
}
Charles Greathouse
Case Western Reserve University