diff --git a/src/fintamath/expressions/binary/DivExpression.cpp b/src/fintamath/expressions/binary/DivExpression.cpp index 96a88764f..a5f55a4f0 100644 --- a/src/fintamath/expressions/binary/DivExpression.cpp +++ b/src/fintamath/expressions/binary/DivExpression.cpp @@ -508,7 +508,6 @@ ArgumentPtr DivExpression::denominatorSumSimplify(const ArgumentPtr &lhs, const if (const auto &childForAdd = denominatorMulSimplify(exprChild->getChildren())) { multiplicator.emplace_back(childForAdd); } - continue; } } @@ -528,13 +527,8 @@ ArgumentPtr DivExpression::denominatorSumSimplify(const ArgumentPtr &lhs, const ArgumentPtr DivExpression::denominatorMulSimplify(const ArgumentsPtrVector &rhsChildren) { ArgumentsPtrVector multiplicator; for (const auto &child : rhsChildren) { - if (const auto &divChild = cast(child)) { - multiplicator.emplace_back(divChild->rhsChild); - continue; - } if (const auto &rationalChild = cast(child)) { multiplicator.emplace_back(std::make_shared(rationalChild->denominator())); - continue; } } diff --git a/tests/src/expressions/ExpressionTests.cpp b/tests/src/expressions/ExpressionTests.cpp index 7f94b2356..5d317e36a 100644 --- a/tests/src/expressions/ExpressionTests.cpp +++ b/tests/src/expressions/ExpressionTests.cpp @@ -205,6 +205,7 @@ TEST(ExpressionTests, stringConstructorTest) { EXPECT_EQ(Expression("(a b)/-2").toString(), "-1/2 a b"); EXPECT_EQ(Expression("(a b)/(-a - b)").toString(), "-b + b^2/(a + b)"); EXPECT_EQ(Expression("(x^5)/(x - y)").toString(), "x^4 + x^3 y + x^2 y^2 + x y^3 + y^4 + y^5/(x - y)"); + EXPECT_EQ(Expression("(3 x + 5/9)/(2y - 9/x + 3/2 x + 1/2 + 2 y / x)").toString(), "2 - (16 y - 72)/(6 x^2 + 8 x y + 2 x + 8 y - 36) + (-16 x^2 y)/(6 x^3 + 8 x^2 y + 2 x^2 + 8 x y - 36 x) + (-16 x)/(54 x^2 + 72 x y + 18 x + 72 y - 324)"); EXPECT_EQ(Expression("0^a").toString(), "0"); EXPECT_EQ(Expression("(a b)^0").toString(), "1");