mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/calc] approximateOutput handles unparsable m_approximateOutputText
This fixes a crash when computing: [[1, 0, -1, 0][0, 1, 1, 0][0, 2, 0, 1][1, 0, 0, 1]]^(-1)
This commit is contained in:
committed by
EmilieNumworks
parent
c84216d918
commit
52ae2a2643
@@ -138,6 +138,11 @@ Expression Calculation::approximateOutput(Context * context) {
|
||||
/* To ensure that the expression 'm_output' is a matrix or a complex, we
|
||||
* call 'evaluate'. */
|
||||
Expression exp = Expression::Parse(m_approximateOutputText);
|
||||
if (exp.isUninitialized()) {
|
||||
/* TODO: exp might be uninitialized because the serialization did not fit in
|
||||
* the buffer. Put a special error instead of "undef". */
|
||||
return Undefined::Builder();
|
||||
}
|
||||
return PoincareHelpers::Approximate<double>(exp, *context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user