* Fix CLN output of a-2. (Chris Dams)
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Wed, 18 Sep 2002 17:05:59 +0000 (17:05 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Wed, 18 Sep 2002 17:05:59 +0000 (17:05 +0000)
ginac/add.cpp

index 7c496bc8d32189f951a7a684d5153f1440d2c2bb..d9da9fba87ca556e167af92ee9858ffe812c54d0 100644 (file)
@@ -144,13 +144,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<print_csrc_cl_N>(c)  // sign inside ctor arguments
-                                       || !(it->coeff.info(info_flags::negative) || (it->coeff.is_equal(_num1) && is_exactly_a<numeric>(it->rest) && it->rest.info(info_flags::negative)))))
+                        && (is_a<print_csrc_cl_N>(c)  // sign inside ctor arguments
+                         || !(it->coeff.info(info_flags::negative) || (it->coeff.is_equal(_num1) && is_exactly_a<numeric>(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<print_csrc_cl_N>(c))  // sign inside ctor argument
                                c.s << '+';
                        overall_coeff.print(c, precedence());
                }