diff --git a/src/main/scala/scalatutorial/sections/FunctionalLoops.scala b/src/main/scala/scalatutorial/sections/FunctionalLoops.scala index c7678da0..036d6e8a 100644 --- a/src/main/scala/scalatutorial/sections/FunctionalLoops.scala +++ b/src/main/scala/scalatutorial/sections/FunctionalLoops.scala @@ -109,9 +109,12 @@ object FunctionalLoops extends ScalaTutorialSection { * (guess + x / guess) / 2 * * def isGoodEnough(guess: Double, x: Double) = - * abs(guess * guess - x) < 0.001 + * math.abs(guess * guess - x) < 0.001 * }}} * + * If we don't want to repeat math.abs every time we use it, we can call `import math.abs` + * at the beginning of the file, and from then on call `abs` directly. + * * Third, we define the `sqrt` function: * * {{{