Print -x as -x instead of -1.0*x when printing C-source.
authorChris Dams <Chris.Dams@mi.infn.it>
Thu, 10 Aug 2006 12:02:42 +0000 (12:02 +0000)
committerChris Dams <Chris.Dams@mi.infn.it>
Thu, 10 Aug 2006 12:02:42 +0000 (12:02 +0000)
ginac/mul.cpp

index e5b38fd6485c1022f1707f75c02d1d20e317fb88..63cc7e72a39e62c29e3e2f7444e458c80e3a5b82 100644 (file)
@@ -218,8 +218,12 @@ void mul::do_print_csrc(const print_csrc & c, unsigned level) const
                c.s << "(";
 
        if (!overall_coeff.is_equal(_ex1)) {
                c.s << "(";
 
        if (!overall_coeff.is_equal(_ex1)) {
-               overall_coeff.print(c, precedence());
-               c.s << "*";
+               if (overall_coeff.is_equal(_ex_1))
+                       c.s << "-";
+               else {
+                       overall_coeff.print(c, precedence());
+                       c.s << "*";
+               }
        }
 
        // Print arguments, separated by "*" or "/"
        }
 
        // Print arguments, separated by "*" or "/"