[poincare] Improve implementation of Division::shallowReduce

Change-Id: Id6b1f6606e5d4aa11b2543151fbba3c7be54551c
This commit is contained in:
Émilie Feral
2017-11-23 14:51:14 +01:00
parent 5acafb0cdb
commit 42e407cad5
2 changed files with 2 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ class Power : public StaticHierarchy<2> {
friend class NthRoot;
friend class SquareRoot;
friend class Addition;
friend class Division;
public:
Type type() const override;
Expression * clone() const override;

View File

@@ -31,7 +31,7 @@ Expression * Division::shallowReduce(Context& context, AngleUnit angleUnit) {
Power * p = new Power(operand(1), new Rational(-1), false);
Multiplication * m = new Multiplication(operand(0), p, false);
detachOperands();
p->deepReduce(context, angleUnit);
p->shallowReduce(context, angleUnit);
replaceWith(m, true);
return m->shallowReduce(context, angleUnit);
}