Fixed bug in gcd (patch from Sheplyakov Alexei).
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 4 May 2005 18:58:43 +0000 (18:58 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 4 May 2005 18:58:43 +0000 (18:58 +0000)
ginac/normal.cpp

index 9e9bde18f0f65a4a9583091986a47250f18312a8..fa09e429f1c563c6ad77298597c88bd8a88aed40 100644 (file)
@@ -1247,11 +1247,7 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const
                        ex dummy;
                        if (divide_in_z(p, g, ca ? *ca : dummy, var) && divide_in_z(q, g, cb ? *cb : dummy, var)) {
                                g *= gc;
-                               ex lc = g.lcoeff(x);
-                               if (is_exactly_a<numeric>(lc) && ex_to<numeric>(lc).is_negative())
-                                       return -g;
-                               else
-                                       return g;
+                               return g;
                        }
                }