From: Chris Dams Date: Thu, 10 Aug 2006 12:02:42 +0000 (+0000) Subject: Print -x as -x instead of -1.0*x when printing C-source. X-Git-Tag: release_1-4-0~74 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=77235661032cfad2ccd0087ad51c53f4d8947faa;hp=36ffb97c48fbbd3acb2b1aa305872e00a4456dc4 Print -x as -x instead of -1.0*x when printing C-source. --- 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 "/"