Programming, Scala, Data Type, Abstraction, Introduction.
going to need to calculate the Greatest Common Divisor. Take a look at the following examples: class Rational(x: Int, y:Int) { private def gcd(a: Int, b: Int) : Int = if (b == 0) a else gcd(b, a % b) private val g = gcd(x, y) def numerator :Int = x def denominator :Int = y // ... } The computation