mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Multiplication::shallowBeautify: removeUnit can only be
called on reduced expression This fixes the following bug: input i+10*sqrt(i)
This commit is contained in:
@@ -356,13 +356,15 @@ Expression Multiplication::shallowBeautify(ExpressionNode::ReductionContext redu
|
||||
}
|
||||
|
||||
Expression result;
|
||||
Expression self = *this;
|
||||
|
||||
// Step 2: Handle the units
|
||||
Expression self = *this;
|
||||
Expression units;
|
||||
self = removeUnit(&units);
|
||||
if (hasUnit()) {
|
||||
Expression units;
|
||||
self = deepReduce(reductionContext); // removeUnit has to be called on reduced expression
|
||||
self = removeUnit(&units);
|
||||
|
||||
if (!units.isUninitialized()) {
|
||||
assert(!units.isUninitialized());
|
||||
ExpressionNode::UnitConversion unitConversionMode = reductionContext.unitConversion();
|
||||
if (unitConversionMode == ExpressionNode::UnitConversion::Default) {
|
||||
/* Step 2a: Recognize derived units
|
||||
|
||||
Reference in New Issue
Block a user