catch NaN too, not just infinite
This commit is contained in:
parent
7f3358856a
commit
3a03be17f9
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
|||
}
|
||||
|
||||
val result = ExpressionBuilder(expression.replace(",", "")).build().evaluate()
|
||||
if (result.isInfinite()) {
|
||||
if (result.isInfinite() || result.isNaN()) {
|
||||
context.toast(R.string.unknown_error_occurred)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue