From 98be622218aca7d70e8ba59434014d596a9fb36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 24 Apr 2018 09:49:53 +0200 Subject: [PATCH] [apps] Calculation: display the exact output even if identical to input --- apps/calculation/calculation.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/calculation/calculation.cpp b/apps/calculation/calculation.cpp index c89ba7283..a6d1f518d 100644 --- a/apps/calculation/calculation.cpp +++ b/apps/calculation/calculation.cpp @@ -68,8 +68,8 @@ void Calculation::setContent(const char * c, Context * context, Expression * ans reset(); m_input = Expression::parse(c); Expression::ReplaceSymbolWithExpression(&m_input, Symbol::SpecialSymbols::Ans, ansExpression); - /* We do not store directly the text enter by the user but its serialization - * to be able to compare it to the exact ouput text. */ + /* We do not store directly the text enter by the user because we do not want + * to keep Ans symbol in the calculation store. */ m_input->writeTextInBuffer(m_inputText, sizeof(m_inputText)); m_exactOutput = Expression::ParseAndSimplify(m_inputText, *context); m_exactOutput->writeTextInBuffer(m_exactOutputText, sizeof(m_exactOutputText)); @@ -186,9 +186,6 @@ bool Calculation::shouldDisplayApproximateOutput(Context * context) { if (strcmp(m_exactOutputText, m_approximateOutputText) == 0) { return true; } - if (strcmp(m_exactOutputText, m_inputText) == 0) { - return true; - } return input()->isApproximate(*context); }