mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 14:50:44 +01:00
[apps/calculation] Do not display additional results for Equal or Store
expressions
This commit is contained in:
@@ -285,7 +285,16 @@ Calculation::EqualSign Calculation::exactAndApproximateDisplayedOutputsAreEqual(
|
||||
Calculation::AdditionalInformationType Calculation::additionalInformationType(Context * context) {
|
||||
Preferences * preferences = Preferences::sharedPreferences();
|
||||
Preferences::ComplexFormat complexFormat = Expression::UpdatedComplexFormatWithTextInput(preferences->complexFormat(), m_inputText);
|
||||
Expression i = input();
|
||||
Expression o = exactOutput();
|
||||
/* Special case for Equal and Store:
|
||||
* Equal/Store nodes have to be at the root of the expression, which prevents
|
||||
* from creating new expressions with equal/store node as a child. We don't
|
||||
* return any additional outputs for them to avoid bothering with special
|
||||
* cases. */
|
||||
if (i.type() == ExpressionNode::Type::Equal || i.type() == ExpressionNode::Type::Store) {
|
||||
return AdditionalInformationType::None;
|
||||
}
|
||||
/* Trigonometry additional results are displayed if either input or output is a sin or a cos. Indeed, we want to capture both cases:
|
||||
* - > input: cos(60)
|
||||
* > output: 1/2
|
||||
|
||||
Reference in New Issue
Block a user