Skip to content

Commit 720f7c8

Browse files
O1O1O1OSimon Waddington
authored and
Simon Waddington
committed
Make sqrt function examples run
1 parent 4b81c24 commit 720f7c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/main/scala/scalatutorial/sections/LexicalScopes.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object LexicalScopes extends ScalaTutorialSection {
3333
* (guess + x / guess) / 2
3434
*
3535
* def isGoodEnough(guess: Double, x: Double) =
36-
* abs(square(guess) - x) < 0.001
36+
* math.abs(guess * guess - x) < 0.001
3737
*
3838
* sqrtIter(1.0, x)
3939
* }
@@ -96,7 +96,7 @@ object LexicalScopes extends ScalaTutorialSection {
9696
* (guess + x / guess) / 2
9797
*
9898
* def isGoodEnough(guess: Double) =
99-
* abs(square(guess) - x) < 0.001
99+
* math.abs(guess * guess - x) < 0.001
100100
*
101101
* sqrtIter(1.0)
102102
* }

0 commit comments

Comments
 (0)