[poincare/power] coding style in denominator

This commit is contained in:
Ruben Dashyan
2019-10-31 17:56:14 +01:00
committed by Léa Saviot
parent 1556e2daad
commit 4bdc2043c8

View File

@@ -895,15 +895,15 @@ Expression Power::denominator(ExpressionNode::ReductionContext reductionContext)
Expression pow = clone();
// If the power is of form x^(-y), denominator should be x^y
Expression positiveIndex = pow.childAtIndex(1).makePositiveAnyNegativeNumeralFactor(reductionContext);
if (!positiveIndex.isUninitialized()) {
// if y was -1, pow is now x^1, denominator is then only x
// we cannot shallowReduce the pow as it is not attached to its parent yet
if (positiveIndex.isRationalOne()) {
return pow.childAtIndex(0);
}
return pow;
if (positiveIndex.isUninitialized()) {
return Expression();
}
return Expression();
// we cannot shallowReduce pow as it is not attached to its parent yet
// if y was -1, pow is now x^1, denominator is then only x
if (positiveIndex.isRationalOne()) {
return pow.childAtIndex(0);
}
return pow;
}
Expression Power::simplifyPowerPower(ExpressionNode::ReductionContext reductionContext) {