From 42e407cad5f10b4e79f61ae8f2f0d051eadb9c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 23 Nov 2017 14:51:14 +0100 Subject: [PATCH] [poincare] Improve implementation of Division::shallowReduce Change-Id: Id6b1f6606e5d4aa11b2543151fbba3c7be54551c --- poincare/include/poincare/power.h | 1 + poincare/src/division.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/poincare/include/poincare/power.h b/poincare/include/poincare/power.h index 1c972497b..eab93f84a 100644 --- a/poincare/include/poincare/power.h +++ b/poincare/include/poincare/power.h @@ -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; diff --git a/poincare/src/division.cpp b/poincare/src/division.cpp index 8d03c7509..2badf3742 100644 --- a/poincare/src/division.cpp +++ b/poincare/src/division.cpp @@ -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); }