mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare] Power: fix one-child addition while reducing power
This commit is contained in:
@@ -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<Addition>().removeChildAtIndexInPlace(0); // p2 = a^(c+...)
|
||||
// if addition had only 2 children
|
||||
childAtIndex(1).convert<Addition>().squashUnaryHierarchyInPlace();
|
||||
Multiplication m = Multiplication(p1);
|
||||
replaceWithInPlace(m);
|
||||
m.addChildAtIndexInPlace(thisRef, 1, 1);
|
||||
|
||||
Reference in New Issue
Block a user