[poincare] Create a a flag on Expression that is set when the

approximation encouters a complex value

All approximation methods take the complex format into account.
This commit is contained in:
Émilie Feral
2018-12-21 17:55:58 +01:00
committed by Léa Saviot
parent c3ad0e027c
commit ecf3f2ea0f
23 changed files with 187 additions and 122 deletions

View File

@@ -1,4 +1,5 @@
#include "storage_function.h"
#include "poincare_helpers.h"
#include <poincare/symbol.h>
#include "poincare/src/parsing/parser.h"
#include <string.h>
@@ -76,7 +77,7 @@ T StorageFunction::templatedApproximateAtAbscissa(T x, Poincare::Context * conte
return NAN;
}
const char unknownX[2] = {Poincare::Symbol::UnknownX, 0};
return expressionReduced(context).approximateWithValueForSymbol(unknownX, x, *context, Preferences::sharedPreferences()->angleUnit());
return PoincareHelpers::ApproximateWithValueForSymbol(expressionReduced(context), unknownX, x, *context);
}
StorageFunction::FunctionRecordData * StorageFunction::recordData() const {