mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[poincare/power] coding style in denominator
This commit is contained in:
committed by
Léa Saviot
parent
1556e2daad
commit
4bdc2043c8
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user