oh my god

This commit is contained in:
DBotThePony 2023-07-05 17:07:59 +07:00
parent 9dcf24cae7
commit 1ad0a41786
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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)
} }