summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-04-09 23:08:48 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-11-10 18:03:22 +0100
commitf3e457db6fbefe3acc95c97e04d1a972ebc5f123 (patch)
tree87c0427f334275f64cc16ec9c7a51f5e3fd908d7
parent73df62063a2426d646b335dd42e36068455c77a6 (diff)
downloadcoursera-f3e457db6fbefe3acc95c97e04d1a972ebc5f123.zip
coursera-f3e457db6fbefe3acc95c97e04d1a972ebc5f123.tar.gz
Scala : simplify use of operators
-rw-r--r--Scala/sandbox/3-rationals.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/Scala/sandbox/3-rationals.scala b/Scala/sandbox/3-rationals.scala
index 868f216..8cdf4d7 100644
--- a/Scala/sandbox/3-rationals.scala
+++ b/Scala/sandbox/3-rationals.scala
@@ -33,9 +33,9 @@ object Rationals {
def run = {
println("Rationals")
- println(new Rational(2, 3).add(new Rational(3, 4)).toString)
- println(new Rational(1, 3).sub(new Rational(5 ,7)).sub(new Rational(3, 2)).toString)
- println(new Rational(1, 3).max(new Rational(5 ,7)).toString)
+ println(new Rational(2, 3) add (new Rational(3, 4)) toString)
+ println(new Rational(1, 3) sub (new Rational(5 ,7)) sub (new Rational(3, 2)) toString)
+ println(new Rational(1, 3) max (new Rational(5 ,7)) toString)
}
}