Commit 87d70593 authored by Heiko Becker's avatar Heiko Becker
Browse files

Change pretty printer of rationals to accurate one for manual testing

parent d17de1b5
......@@ -410,10 +410,10 @@ class Rational private(val n: BigInt, val d: BigInt) extends ScalaNumber with Sc
def *(other: Rational): Rational = Rational(n * other.n, d * other.d)
def /(other: Rational): Rational = Rational(n * other.d, d* other.n)
override def toString: String = niceDoubleString(this.toDouble)
def toFractionString: String = "(%s)/(%s)".format(n.toString, d.toString)
override def toString: String = toFractionString
def integerPart: Int = doubleValue.toInt
def longPart: Long = doubleValue.toLong
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment