mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Revert "[poincare/multiplication] Fix handling of units with non-integer exponent"
This reverts commit 50f1ee9721.
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.
This commit is contained in:
committed by
Émilie Feral
parent
1351babe37
commit
b8786dd32c
@@ -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<Rational&>(exponent).isInteger()) {
|
||||
factorsUnit = factor;
|
||||
} else {
|
||||
factorsNumerator = factor;
|
||||
}
|
||||
factorsUnit = factor;
|
||||
} else {
|
||||
factorsNumerator = factor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user