math.sqrt() / math.pow()
Square root, powers, and absolute value.
Syntax
math.sqrt(x) math.pow(x,y) math.abs(x)
Description
The scala.math package can be used directly: sqrt, pow, abs, round.
Example
Loading editor…
This language is for reference/learning only — copy the code and try it in your own environment.
Expected output
9.0 1024.0 5
When to use?
Geometry, statistics, exponential calculations.