mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 04:00:02 +02:00
[poincare] Clean
Change-Id: Ia21be93687035b302286a178a91f4a676f052c5b
This commit is contained in:
@@ -214,8 +214,7 @@ Expression * Multiplication::immediateBeautify() {
|
||||
return e->immediateBeautify();
|
||||
}
|
||||
assert(e == this);
|
||||
int index = 0;
|
||||
while (index < numberOfOperands()) {
|
||||
for (int index = 0; index < numberOfOperands(); index++) {
|
||||
// a*b^(-1)*... -> a*.../b
|
||||
if (operand(index)->type() == Type::Power && operand(index)->operand(1)->type() == Type::Rational && static_cast<const Rational *>(operand(index)->operand(1))->isMinusOne()) {
|
||||
Power * p = static_cast<Power *>((Expression *)operand(index));
|
||||
@@ -253,8 +252,8 @@ Expression * Multiplication::immediateBeautify() {
|
||||
replaceWith(d, true);
|
||||
return d;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
// -1*A -> -A
|
||||
if (operand(0)->type() == Type::Rational && static_cast<const Rational *>(operand(0))->isMinusOne()) {
|
||||
removeOperand((Expression *)operand(0), true);
|
||||
Expression * e = squashUnaryHierarchy();
|
||||
|
||||
Reference in New Issue
Block a user