From: Christian Bauer Date: Thu, 20 Feb 2003 22:40:45 +0000 (+0000) Subject: 'x+I' was missing the plus sign in the C source output X-Git-Tag: release_1-1-0~22 X-Git-Url: https://www.ginac.de/ginac.git/tutorial/ginac.git?a=commitdiff_plain;h=0443769c1345121d4aa4828a327af6bcfdb7d2e9;p=ginac.git 'x+I' was missing the plus sign in the C source output --- diff --git a/ginac/add.cpp b/ginac/add.cpp index 96469915..b409513c 100644 --- a/ginac/add.cpp +++ b/ginac/add.cpp @@ -145,14 +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 + && (is_a(c) || !it->coeff.info(info_flags::real) // 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) - || is_a(c)) // sign inside ctor argument + || is_a(c) || !overall_coeff.info(info_flags::real)) // sign inside ctor argument c.s << '+'; overall_coeff.print(c, precedence()); }