From b8786dd32c3ff4aea058f40b6d064b8fef13d437 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Fri, 27 Mar 2020 09:52:52 +0100 Subject: [PATCH] Revert "[poincare/multiplication] Fix handling of units with non-integer exponent" This reverts commit 50f1ee97210bba7a3420ea7711245598489ff4cf. Since Power::shallowReduce now checks that the exponent of a Unit is an Integer, instead of Unit::shallowBeautify, there is no need anymore to handle that in Multiplication::splitIntoNormalForm. --- poincare/src/multiplication.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/poincare/src/multiplication.cpp b/poincare/src/multiplication.cpp index ae83023e6..241f21e27 100644 --- a/poincare/src/multiplication.cpp +++ b/poincare/src/multiplication.cpp @@ -1032,20 +1032,7 @@ void Multiplication::splitIntoNormalForm(Expression & numerator, Expression & de Expression fd = factor.denominator(reductionContext); if (fd.isUninitialized()) { if (factor.childAtIndex(0).type() == ExpressionNode::Type::Unit) { - /* A Unit should only have integer exponents, otherwise - * simplification returns Undefined. That will be handled later in - * Unit::shallowBeautify: since an Expression is beautified from - * children to parent, the children of the current Multiplication are - * not beautified yet and the exponent of a Unit is not guaranted at - * this point to be an integer. Until then, any Unit with non-integer - * exponent, is flushed into the numerator instead of units. - */ - Expression exponent = factor.childAtIndex(1); - if (exponent.type() == ExpressionNode::Type::Rational && static_cast(exponent).isInteger()) { - factorsUnit = factor; - } else { - factorsNumerator = factor; - } + factorsUnit = factor; } else { factorsNumerator = factor; }