]> www.ginac.de Git - ginac.git/blobdiff - ginac/factor.cpp
Happy New Year!
[ginac.git] / ginac / factor.cpp
index cfb9e29d9000b81410b4dba4858cdd62325ba1ac..2b77d1b0110f3e327216a11a20510b901a6b93ee 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 /*
- *  GiNaC Copyright (C) 1999-2017 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -1953,7 +1953,7 @@ static vector<ex> multivar_diophant(const vector<ex>& a_, const ex& x, const ex&
                                delta_s[j] = delta_s[j] * modcm;
                                sigma[j] = sigma[j] + umodpoly_to_ex(delta_s[j], x);
                        }
-                       if ( nterms > 1 ) {
+                       if ( nterms > 1 && i+1 != nterms ) {
                                z = c.op(i+1);
                        }
                }