diff --git a/src/main/kotlin/hm/binkley/math/maths.kt b/src/main/kotlin/hm/binkley/math/maths.kt index ce8e6293..82888c07 100644 --- a/src/main/kotlin/hm/binkley/math/maths.kt +++ b/src/main/kotlin/hm/binkley/math/maths.kt @@ -10,10 +10,10 @@ import java.math.BigInteger.ZERO internal typealias BInt = BigInteger internal typealias BDouble = BigDecimal -internal fun BInt.isZero() = this == ZERO -internal fun BInt.isOne() = this == ONE -internal fun BInt.isTwo() = this == TWO -internal fun BInt.isTen() = this == TEN +internal fun BInt.isZero() = ZERO == this +internal fun BInt.isOne() = ONE == this +internal fun BInt.isTwo() = TWO == this +internal fun BInt.isTen() = TEN == this internal fun BInt.isDyadic() = (isOne() || (this % TWO).isZero()) @@ -22,4 +22,4 @@ internal fun BInt.isPAdic(p: Long) = internal fun BInt.lcm(other: BInt) = (this * (other / gcd(other))).abs() -internal fun BInt.isEven() = ZERO == this % TWO +internal fun BInt.isEven() = (this % TWO).isZero()