mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-04-13 09:42:09 +02:00
catch NaN too, not just infinite
This commit is contained in:
parent
7f3358856a
commit
3a03be17f9
@ -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…
x
Reference in New Issue
Block a user