Fix Division Operation
This commit is contained in:
parent
0a31ad06ea
commit
673efc8e00
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ package com.simplemobiletools.calculator.operation
|
|||
import com.simplemobiletools.calculator.operation.base.BinaryOperation
|
||||
import com.simplemobiletools.calculator.operation.base.Operation
|
||||
import java.math.BigDecimal
|
||||
import java.math.MathContext.DECIMAL128
|
||||
|
||||
class DivideOperation(baseValue: BigDecimal, secondValue: BigDecimal) : BinaryOperation(baseValue, secondValue), Operation {
|
||||
|
||||
|
@ -10,7 +11,7 @@ class DivideOperation(baseValue: BigDecimal, secondValue: BigDecimal) : BinaryOp
|
|||
return if (secondValue.compareTo(BigDecimal.ZERO) == 0) {
|
||||
BigDecimal.ZERO
|
||||
} else {
|
||||
baseValue.divide(secondValue)
|
||||
baseValue.divide(secondValue, DECIMAL128)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue