Merge pull request #231 from Aga-C/fix-sign-change

Fixed changing operator after dividing by zero (#202)
This commit is contained in:
Tibor Kaputa
2021-12-29 21:52:47 +01:00
committed by GitHub

View File

@@ -118,8 +118,14 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
}
}
if (getSecondValue() == 0.0 && inputDisplayedFormula.contains("÷")) {
lastKey = DIVIDE
lastOperation = DIVIDE
} else {
lastKey = operation
lastOperation = operation
}
showNewResult(inputDisplayedFormula)
}