Commit ad293692 authored by Heiko Becker's avatar Heiko Becker

Merge with certificates branch from ava daisy, to obtain clean history

parents d75034f4 119c29fb
......@@ -421,8 +421,6 @@ 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)
def toFractionString: String = "(%s)/(%s)".format(n.toString, d.toString)
override def toString: String = niceDoubleString(this.toDouble)
def toLongString: String = {
......@@ -431,6 +429,8 @@ class Rational private(val n: BigInt, val d: BigInt) extends ScalaNumber with Sc
bigN.divide(bigD, mathContext).toString
}
def toFractionString: String = "(%s)/(%s)".format(n.toString, d.toString)
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