diff options
author | Martin Odersky <odersky@gmail.com> | 2003-11-07 12:11:21 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-11-07 12:11:21 +0000 |
commit | 4bab79034d0056fb9982cbf31491880f961f8b53 (patch) | |
tree | 8cfdc73de23393c12c83098e57fcef34839afeb1 /doc/reference/ScalaByExample.tex | |
parent | fc7e1bce49d8fd89b25b70277237ed41fb24965d (diff) | |
download | scala-4bab79034d0056fb9982cbf31491880f961f8b53.tar.gz scala-4bab79034d0056fb9982cbf31491880f961f8b53.tar.bz2 scala-4bab79034d0056fb9982cbf31491880f961f8b53.zip |
*** empty log message ***
Diffstat (limited to 'doc/reference/ScalaByExample.tex')
-rw-r--r-- | doc/reference/ScalaByExample.tex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/reference/ScalaByExample.tex b/doc/reference/ScalaByExample.tex index bea8c37665..7849be4882 100644 --- a/doc/reference/ScalaByExample.tex +++ b/doc/reference/ScalaByExample.tex @@ -1397,9 +1397,9 @@ As an example of how rational numbers can be used, here's a program that prints the sum of all numbers $1/i$ where $i$ ranges from 1 to 10. \begin{lstlisting} var i = 1; -var x = Rational(0, 1); +var x = new Rational(0, 1); while (i <= 10) { - x = x + Rational(1,i); + x = x + new Rational(1,i); i = i + 1; } System.out.println(x.numer + "/" + x.denom); |