Skip to content

Commit

Permalink
Use math.abs and math.pow so sqrt example runs
Browse files Browse the repository at this point in the history
  • Loading branch information
O1O1O1O authored Feb 1, 2018
1 parent 4b81c24 commit fef9e91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/scalatutorial/sections/LexicalScopes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object LexicalScopes extends ScalaTutorialSection {
* (guess + x / guess) / 2
*
* def isGoodEnough(guess: Double, x: Double) =
* abs(square(guess) - x) < 0.001
* math.abs(math.pow(guess, 2) - x) < 0.001
*
* sqrtIter(1.0, x)
* }
Expand Down

0 comments on commit fef9e91

Please # to comment.