From 9a79081b4794437aa0ae5d672114f7bea523b44f Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Wed, 26 Feb 2020 16:35:56 +0100 Subject: [PATCH] [poincare/expression] Fix typo in nextIntersection The approximative solution should be rounded up to zero if it is dominated by the solver's precision. --- poincare/src/expression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poincare/src/expression.cpp b/poincare/src/expression.cpp index a4793bc69..0b55f61a7 100644 --- a/poincare/src/expression.cpp +++ b/poincare/src/expression.cpp @@ -1003,7 +1003,7 @@ Coordinate2D Expression::nextIntersection(const char * symbol, double st return expression0->approximateWithValueForSymbol(symbol, x, context, complexFormat, angleUnit)-expression1->approximateWithValueForSymbol(symbol, x, context, complexFormat, angleUnit); }, context, complexFormat, angleUnit, expression); Coordinate2D result(resultAbscissa, approximateWithValueForSymbol(symbol, resultAbscissa, context, complexFormat, angleUnit)); - if (std::fabs(result.x2()) < step*k_solverPrecision) { + if (std::fabs(result.x2()) < std::fabs(step)*k_solverPrecision) { result.setX2(0.0); } return result;