From 77235661032cfad2ccd0087ad51c53f4d8947faa Mon Sep 17 00:00:00 2001 From: Chris Dams Date: Thu, 10 Aug 2006 12:02:42 +0000 Subject: [PATCH] Print -x as -x instead of -1.0*x when printing C-source. --- ginac/mul.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ginac/mul.cpp b/ginac/mul.cpp index e5b38fd6..63cc7e72 100644 --- a/ginac/mul.cpp +++ b/ginac/mul.cpp @@ -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 "/" -- 2.44.0