[poincare/unit_convert] Fix UnitConvert::shallowReduce

This commit is contained in:
Léa Saviot
2020-02-05 11:23:25 +01:00
parent d98eddf960
commit ecdcb100fb
4 changed files with 25 additions and 15 deletions

View File

@@ -453,14 +453,6 @@ int Expression::getPolynomialReducedCoefficients(const char * symbolName, Expres
return degree;
}
bool Expression::isUnitsOnly(Context * context) const {
if (type() == ExpressionNode::Type::Unit) {
return true;
}
Expression thisBeautified = clone().reduce(ExpressionNode::ReductionContext(context, Preferences::ComplexFormat::Real, Preferences::AngleUnit::Degree, ExpressionNode::ReductionTarget::SystemForApproximation, ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithUndefinedAndDoNotReplaceUnits)); // The values do not really matter except for the symbolicComputation
return thisBeautified.reducedExpressionIsUnitsOnly();
}
/* Complex */
bool Expression::EncounteredComplex() {