Math.sqrt() / Math.pow()
Square root, powers, and absolute value.
Syntax
Math.sqrt(x) Math.pow(x,y) Math.abs(x)
Description
Java's Math class can be used directly. The kotlin.math package also provides functions like sqrt and pow.
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.