]> www.ginac.de Git - ginac.git/blobdiff - ginac/power.cpp
Fix pow(+(...),2).expand().
[ginac.git] / ginac / power.cpp
index b2460fda8661d234dc8c4b6fb30890c5d1920465..6fa619cafcfb6a878c5dab22fac32cfd1e4e7b29 100644 (file)
@@ -1051,14 +1051,14 @@ ex power::expand_add_2(const add & a, unsigned options) const
                for (epvector::const_iterator cit1=cit0+1; cit1!=last; ++cit1) {
                        const ex & r1 = cit1->rest;
                        const ex & c1 = cit1->coeff;
-                       sum.push_back(a.combine_ex_with_coeff_to_pair((new mul(r,r1))->setflag(status_flags::dynallocated),
+                       sum.push_back(a.combine_ex_with_coeff_to_pair(mul(r,r1).expand(options),
                                                                      _num2_p->mul(ex_to<numeric>(c)).mul_dyn(ex_to<numeric>(c1))));
                }
        }
        
        GINAC_ASSERT(sum.size()==(a.seq.size()*(a.seq.size()+1))/2);
        
-       // second part: add terms coming from overall_factor (if != 0)
+       // second part: add terms coming from overall_coeff (if != 0)
        if (!a.overall_coeff.is_zero()) {
                epvector::const_iterator i = a.seq.begin(), end = a.seq.end();
                while (i != end) {