scala - error: not found: value

catch23 picture catch23 · Aug 18, 2013 · Viewed 32.1k times · Source

I newly at scala and tried to pass some easy scala worksheet.

IDE is Intellij IDEA community edition and OS Ubuntu 12.04, sbt was installed correctly.

But it throws error - error: not found: value

OI can't understand why this happen:

Code:

Answer

Shadowlands picture Shadowlands · Aug 18, 2013

The complete error message is error: not found: value abs. The value "abs" wan't found. You want math.abs. Alternatively you could add import math._ somewhere before you need these math functions.