mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-03 09:17:35 +01:00
Merge pull request #231 from Aga-C/fix-sign-change
Fixed changing operator after dividing by zero (#202)
This commit is contained in:
commit
5293466274
@ -118,8 +118,14 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
lastKey = operation
|
||||
lastOperation = operation
|
||||
if (getSecondValue() == 0.0 && inputDisplayedFormula.contains("÷")) {
|
||||
lastKey = DIVIDE
|
||||
lastOperation = DIVIDE
|
||||
} else {
|
||||
lastKey = operation
|
||||
lastOperation = operation
|
||||
}
|
||||
|
||||
showNewResult(inputDisplayedFormula)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user