From cffb144c4197af3091858d6380d0be1464dc83ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 19 Nov 2018 16:56:27 +0100 Subject: [PATCH] [poincare] Power: fix one-child addition while reducing power --- poincare/src/power.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index 2a00e5b9a..9a46b7687 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -515,6 +515,8 @@ Expression Power::shallowReduce(Context & context, Preferences::AngleUnit angleU Power p1 = Power(childAtIndex(0).clone(), a.childAtIndex(0).clone()); Power thisRef = *this; childAtIndex(1).convert().removeChildAtIndexInPlace(0); // p2 = a^(c+...) + // if addition had only 2 children + childAtIndex(1).convert().squashUnaryHierarchyInPlace(); Multiplication m = Multiplication(p1); replaceWithInPlace(m); m.addChildAtIndexInPlace(thisRef, 1, 1);