diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt index 267509fb1..e91bc36a9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt @@ -142,9 +142,9 @@ class Decimal private constructor(val mag: BigInteger, marker: Nothing?) : Numbe operator fun times(other: Decimal): Decimal { if (other.mag.signum() == 0) { return ZERO - } else if (other.mag == BigInteger.ONE) { + } else if (other == ONE) { return this - } else if (other.mag == BI_MINUS_ONE) { + } else if (other == MINUS_ONE) { return Decimal(-mag, null) } @@ -161,9 +161,9 @@ class Decimal private constructor(val mag: BigInteger, marker: Nothing?) : Numbe operator fun div(other: Decimal): Decimal { if (other.mag.signum() == 0) { throw ArithmeticException("Attempt to divide $this by zero") - } else if (other.mag == BigInteger.ONE) { + } else if (other == ONE) { return this - } else if (other.mag == BI_MINUS_ONE) { + } else if (other == MINUS_ONE) { return Decimal(-mag, null) }