Commit e21517b8 authored by antoine lucas's avatar antoine lucas
Browse files

fix factoize out of bounds

parent 3154d6ba
......@@ -65,9 +65,11 @@ factor_using_division (mpz_t t, bigvec & factors)
{
if (! mpz_divisible_ui_p (t, p))
{
p += primes_diff[i++];
if (mpz_cmp_ui (t, p * p) < 0)
break;
if (i < PRIMES_PTAB_ENTRIES) {
p += primes_diff[i++];
if (mpz_cmp_ui (t, p * p) < 0)
break;
} else break;
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment