system.math
The system.math module provides mathematical functions and constants.
Import
import system.math as math;
Functions
Basic Math
abs(x)- Absolute valuefloor(x)- Round downceil(x)- Round upround(x)- Round to nearestmin(a, b)- Minimum of two valuesmax(a, b)- Maximum of two values
Powers and Roots
sqrt(x)- Square rootpow(base, exp)- Powerexp(x)- e^xlog(x)- Natural logarithmlog10(x)- Base-10 logarithm
Trigonometry
sin(x),cos(x),tan(x)asin(x),acos(x),atan(x)
Example
import system.math as math;
import system.io as io;
let x = 16.0;
io.out.println("sqrt(16) =", math.sqrt(x));
io.out.println("2^8 =", math.pow(2.0, 8.0));
io.out.println("sin(0) =", math.sin(0.0));
See the full API reference for more details.