Print -x as -x instead of -1.0*x when printing C-source.
[ginac.git] / 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)) {
-               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 "/"