Skip to content

Commit

Permalink
fix: use correct var name
Browse files Browse the repository at this point in the history
  • Loading branch information
lbressler13 committed Jan 23, 2024
1 parent f02a2c6 commit aa7a355
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package xyz.lbres.exactnumbers.exactfraction

/**
* [ArithmeticException] for ExactFraction overflow.
* Has field for string of value that caused overflow.
* Has field for string representation of value that caused overflow
*/
class ExactFractionOverflowException() : ArithmeticException() {
override var message: String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ internal fun simplifyFraction(numerator: BigInteger, denominator: BigInteger): T

// move negatives to numerator
if (newDenominator.isNegative()) {
newNumerator = -numerator
newDenominator = -denominator
newNumerator = -newNumerator
newDenominator = -newDenominator
}

// simplify using greatest common divisor
if (newNumerator != BigInteger.ZERO) {
val gcd = getGCD(numerator, denominator)
val gcd = getGCD(newNumerator, newDenominator)
newNumerator /= gcd
newDenominator /= gcd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ private val testNumber1 = TestNumber(ExactFraction(3, 4))
private val testNumber2 = TestNumber(ExactFraction.SEVEN)
private val one = ExactFraction.ONE

@Suppress("Deprecated")
fun runGetFactorsByTypeTests() {
val types = listOf(Log.TYPE, Pi.TYPE, Sqrt.TYPE, TestNumber.TYPE)

Expand Down

0 comments on commit aa7a355

Please sign in to comment.