From 46a959131cb58c2ed61fcef28d435da032beb063 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Wed, 18 Sep 2002 17:06:12 +0000 Subject: [PATCH] * Fix CLN output of a-2. (Chris Dams) --- ginac/add.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ginac/add.cpp b/ginac/add.cpp index f7ca4d25..f3721e66 100644 --- a/ginac/add.cpp +++ b/ginac/add.cpp @@ -145,13 +145,14 @@ void add::print(const print_context & c, unsigned level) const // Separator is "+", except if the following expression would have a leading minus sign or the sign is sitting in parenthesis (as in a ctor) ++it; if (it != itend - && (is_a(c) // sign inside ctor arguments - || !(it->coeff.info(info_flags::negative) || (it->coeff.is_equal(_num1) && is_exactly_a(it->rest) && it->rest.info(info_flags::negative))))) + && (is_a(c) // sign inside ctor arguments + || !(it->coeff.info(info_flags::negative) || (it->coeff.is_equal(_num1) && is_exactly_a(it->rest) && it->rest.info(info_flags::negative))))) c.s << "+"; } if (!overall_coeff.is_zero()) { - if (overall_coeff.info(info_flags::positive)) + if (overall_coeff.info(info_flags::positive) + || is_a(c)) // sign inside ctor argument c.s << '+'; overall_coeff.print(c, precedence()); } -- 2.49.0