oh my god
This commit is contained in:
parent
9dcf24cae7
commit
1ad0a41786
@ -142,9 +142,9 @@ class Decimal private constructor(val mag: BigInteger, marker: Nothing?) : Numbe
|
|||||||
operator fun times(other: Decimal): Decimal {
|
operator fun times(other: Decimal): Decimal {
|
||||||
if (other.mag.signum() == 0) {
|
if (other.mag.signum() == 0) {
|
||||||
return ZERO
|
return ZERO
|
||||||
} else if (other.mag == BigInteger.ONE) {
|
} else if (other == ONE) {
|
||||||
return this
|
return this
|
||||||
} else if (other.mag == BI_MINUS_ONE) {
|
} else if (other == MINUS_ONE) {
|
||||||
return Decimal(-mag, null)
|
return Decimal(-mag, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,9 +161,9 @@ class Decimal private constructor(val mag: BigInteger, marker: Nothing?) : Numbe
|
|||||||
operator fun div(other: Decimal): Decimal {
|
operator fun div(other: Decimal): Decimal {
|
||||||
if (other.mag.signum() == 0) {
|
if (other.mag.signum() == 0) {
|
||||||
throw ArithmeticException("Attempt to divide $this by zero")
|
throw ArithmeticException("Attempt to divide $this by zero")
|
||||||
} else if (other.mag == BigInteger.ONE) {
|
} else if (other == ONE) {
|
||||||
return this
|
return this
|
||||||
} else if (other.mag == BI_MINUS_ONE) {
|
} else if (other == MINUS_ONE) {
|
||||||
return Decimal(-mag, null)
|
return Decimal(-mag, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user