mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 15:20:39 +01:00
[poincare/expression] Add escape case on uninitialized expression
This commit is contained in:
@@ -428,6 +428,9 @@ U Expression::approximateToScalar(Context& context, Preferences::AngleUnit angle
|
||||
template<typename U>
|
||||
U Expression::approximateToScalar(const char * text, Context& context, Preferences::AngleUnit angleUnit) {
|
||||
Expression exp = ParseAndSimplify(text, context, angleUnit);
|
||||
if (exp.isUninitialized()) {
|
||||
return NAN;
|
||||
}
|
||||
return exp.approximateToScalar<U>(context, angleUnit);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user