mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[calculation] Use ParseAndSimplifyForComplexFormat instead of
ParseAndSimplify
This commit is contained in:
@@ -41,7 +41,7 @@ void Calculation::setContent(const char * c, Context * context, Expression ansEx
|
||||
* to keep Ans symbol in the calculation store. */
|
||||
PoincareHelpers::Serialize(input, m_inputText, sizeof(m_inputText));
|
||||
}
|
||||
Expression exactOutput = PoincareHelpers::ParseAndSimplify(m_inputText, *context);
|
||||
Expression exactOutput = PoincareHelpers::ParseAndSimplifyForComplexFormat(m_inputText, *context);
|
||||
PoincareHelpers::Serialize(exactOutput, m_exactOutputText, sizeof(m_exactOutputText));
|
||||
Expression approximateOutput = PoincareHelpers::Approximate<double>(exactOutput, *context);
|
||||
PoincareHelpers::Serialize(approximateOutput, m_approximateOutputText, sizeof(m_approximateOutputText));
|
||||
|
||||
@@ -41,6 +41,10 @@ inline Poincare::Expression ParseAndSimplify(const char * text, Poincare::Contex
|
||||
return Poincare::Expression::ParseAndSimplify(text, context, Poincare::Preferences::sharedPreferences()->angleUnit());
|
||||
}
|
||||
|
||||
inline Poincare::Expression ParseAndSimplifyForComplexFormat(const char * text, Poincare::Context & context) {
|
||||
return Poincare::Expression::ParseAndSimplifyForComplexFormat(text, context, Poincare::Preferences::sharedPreferences()->angleUnit(), Poincare::Preferences::sharedPreferences()->complexFormat());
|
||||
}
|
||||
|
||||
inline void Simplify(Poincare::Expression * e, Poincare::Context & context) {
|
||||
*e = e->simplify(context, Poincare::Preferences::sharedPreferences()->angleUnit());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user