[poincare] Replace complex constructors by named constructors

Change-Id: I6aad82edfb1bd243c4537a48888655608b90eeb5
This commit is contained in:
Émilie Feral
2017-02-14 17:05:18 +01:00
parent 7cbfd37925
commit dc7a629dfa
32 changed files with 96 additions and 82 deletions

View File

@@ -6,7 +6,7 @@ namespace Poincare {
VariableContext::VariableContext(char name, Context * parentContext) :
m_name(name),
m_value(Complex(0.0f)),
m_value(Complex::Float(0.0f)),
m_parentContext(parentContext)
{
}
@@ -15,7 +15,7 @@ void VariableContext::setExpressionForSymbolName(Expression * expression, const
if (symbol->name() == m_name) {
assert(expression->type() == Expression::Type::Complex);
/* WARNING: We assume that the evaluation of expression is a reel */
m_value = Complex(expression->approximate(*m_parentContext, Preferences::sharedPreferences()->angleUnit()));
m_value = Complex::Float(expression->approximate(*m_parentContext, Preferences::sharedPreferences()->angleUnit()));
} else {
m_parentContext->setExpressionForSymbolName(expression, symbol);
}