]> www.ginac.de Git - ginac.git/commitdiff
pgcd(): avoid infinite loop if the first GCD candidate coincides with GCD
authorAlexei Sheplyakov <alexei.sheplyakov@gmail.com>
Mon, 17 May 2010 22:17:26 +0000 (00:17 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Mon, 17 May 2010 22:44:23 +0000 (00:44 +0200)
136 if (H_lcoeff.is_equal(lc_gcd)) {
137 if ((Hprev-H).expand().smod(pn).is_zero()) // (*)
138 continue;

The check (*) can result in infinite loop if the (very) first GCD candidate
gives the correct GCD: any subsequent iterations give the same result, so
Hprev and H will be equal (hence the infinite loop). That check is not very
useful (AFAIR I was trying to avoid extra division checks), so let's remove it.


No differences found