From 3fd737ab721c4ea39cbac7d2dc5a2c2f71a616cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 27 Dec 2018 14:02:58 +0100 Subject: [PATCH] [poincare] Change name: sApproximationEncounterComplex --> sApproximationEncounteredComplex --- poincare/include/poincare/expression.h | 2 +- poincare/src/derivative.cpp | 2 +- poincare/src/expression.cpp | 10 +++++----- poincare/src/integral.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/poincare/include/poincare/expression.h b/poincare/include/poincare/expression.h index ae6d8dde2..9db6f5428 100644 --- a/poincare/include/poincare/expression.h +++ b/poincare/include/poincare/expression.h @@ -194,7 +194,7 @@ public: Expression degreeToRadian(); /* Approximation Helper */ - // These methods reset the sApproximationEncounterComplex flag. They should not be use to implement node approximation + // These methods reset the sApproximationEncounteredComplex flag. They should not be use to implement node approximation template static U epsilon(); template Expression approximate(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const; template U approximateToScalar(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const; diff --git a/poincare/src/derivative.cpp b/poincare/src/derivative.cpp index b59f02091..a6675617f 100644 --- a/poincare/src/derivative.cpp +++ b/poincare/src/derivative.cpp @@ -78,7 +78,7 @@ T DerivativeNode::approximateWithArgument(T x, Context & context, Preferences::A assert(childAtIndex(1)->type() == Type::Symbol); VariableContext variableContext = VariableContext(static_cast(childAtIndex(1))->name(), &context); variableContext.setApproximationForVariable(x); - // Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounterComplex flag + // Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounteredComplex flag return childAtIndex(0)->approximate(T(), variableContext, angleUnit).toScalar(); } diff --git a/poincare/src/expression.cpp b/poincare/src/expression.cpp index 793762992..a2e0d9c80 100644 --- a/poincare/src/expression.cpp +++ b/poincare/src/expression.cpp @@ -14,7 +14,7 @@ namespace Poincare { bool Expression::sSymbolReplacementsCountLock = false; -static bool sApproximationEncounterComplex = false; +static bool sApproximationEncounteredComplex = false; /* Constructor & Destructor */ @@ -280,11 +280,11 @@ Expression Expression::makePositiveAnyNegativeNumeralFactor(Context & context, P template Evaluation Expression::approximateToEvaluation(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const { - sApproximationEncounterComplex = false; + sApproximationEncounteredComplex = false; // Reset interrupting flag because some evaluation methods use it sSimplificationHasBeenInterrupted = false; Evaluation e = node()->approximate(U(), context, angleUnit); - if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounterComplex) { + if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounteredComplex) { e = Complex::Undefined(); } return e; @@ -330,7 +330,7 @@ Expression Expression::defaultReplaceUnknown(const Symbol & symbol) { /* Complex */ void Expression::SetEncounterComplex(bool encounterComplex) { - sApproximationEncounterComplex = encounterComplex; + sApproximationEncounteredComplex = encounterComplex; } Preferences::ComplexFormat Expression::UpdatedComplexFormatWithTextInput(Preferences::ComplexFormat complexFormat, const char * textInput) { @@ -599,7 +599,7 @@ bool Expression::isMinusOne(const Expression e) { } Expression Expression::CreateComplexExpression(Expression ra, Expression tb, Preferences::ComplexFormat complexFormat, bool undefined, bool isZeroRa, bool isOneRa, bool isZeroTb, bool isOneTb, bool isNegativeRa, bool isNegativeTb) { - if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounterComplex) { + if (complexFormat == Preferences::ComplexFormat::Real && sApproximationEncounteredComplex) { return Unreal(); } else if (undefined) { return Undefined(); diff --git a/poincare/src/integral.cpp b/poincare/src/integral.cpp index 8d4383147..187bf27cf 100644 --- a/poincare/src/integral.cpp +++ b/poincare/src/integral.cpp @@ -67,7 +67,7 @@ Evaluation IntegralNode::templatedApproximate(Context & context, Preferences: template T IntegralNode::functionValueAtAbscissa(T x, Context & context, Preferences::AngleUnit angleUnit) const { - // Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounterComplex flag + // Here we cannot use Expression::approximateWithValueForSymbol which would reset the sApproximationEncounteredComplex flag assert(childAtIndex(1)->type() == Type::Symbol); VariableContext variableContext = VariableContext(static_cast(childAtIndex(1))->name(), &context); variableContext.setApproximationForVariable(x);