mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 06:10:31 +01:00
[poincare] Replace complex constructors by named constructors
Change-Id: I6aad82edfb1bd243c4537a48888655608b90eeb5
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user