mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
Merge pull request #207 from AlbertoPellitteri/fix-division-by-zero-bug
Fix division by zero bug
This commit is contained in:
@ -147,6 +147,11 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
|||||||
|
|
||||||
secondValue = getSecondValue()
|
secondValue = getSecondValue()
|
||||||
calculateResult()
|
calculateResult()
|
||||||
|
if ((lastOperation == DIVIDE || lastOperation == PERCENT) && secondValue == 0.0) {
|
||||||
|
lastKey = DIGIT
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
lastKey = EQUALS
|
lastKey = EQUALS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user