diff --git a/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/exceptions/CastingOverflowException.kt b/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/exceptions/CastingOverflowException.kt index 00b9b5d..2d59d2c 100644 --- a/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/exceptions/CastingOverflowException.kt +++ b/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/exceptions/CastingOverflowException.kt @@ -7,19 +7,16 @@ class CastingOverflowException private constructor( baseType: String, targetType: String, valueString: String, - overflowValue: Any?, + val overflowValue: Any?, noArgsConstructor: Boolean ) : ArithmeticException() { override val message: String? - val overflowValue: Any? init { - if (noArgsConstructor) { - this.message = null - this.overflowValue = null + this.message = if (noArgsConstructor) { + null } else { - this.message = "Overflow casting value $valueString of type $baseType to $targetType" - this.overflowValue = overflowValue + "Overflow casting value $valueString of type $baseType to $targetType" } } diff --git a/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/irrationals/IrrationalNumber.kt b/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/irrationals/IrrationalNumber.kt index a07c3cf..d825aca 100644 --- a/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/irrationals/IrrationalNumber.kt +++ b/exact-numbers/src/main/kotlin/xyz/lbres/exactnumbers/irrationals/IrrationalNumber.kt @@ -28,7 +28,7 @@ abstract class IrrationalNumber> : Comparable, Number */ abstract val isInverted: Boolean @Deprecated("Property $deprecatedV1", ReplaceWith("isInverted"), DeprecationLevel.WARNING) - val isDivided: Boolean + val isDivided: Boolean // maintained from Irrational interface get() = isInverted /** @@ -57,7 +57,7 @@ abstract class IrrationalNumber> : Comparable, Number abstract fun inverse(): T @Deprecated("Method $deprecatedV1", ReplaceWith("inverse"), DeprecationLevel.WARNING) - fun swapDivided(): T = inverse() + fun swapDivided(): T = inverse() // maintained from Irrational interface operator fun times(other: IrrationalNumber<*>): Term = Term.fromValues(ExactFraction.ONE, listOf(this, other)) operator fun times(other: ExactFraction): Term = Term.fromValues(other, listOf(this))