Math Functions




The Math library holds a lot of common math functions (methods).

Example:

// Math.abs() returns the absolute value of a number
// 7.9 is returned in the function below.
double x = Math.abs(-7.9);


// 8.0 is returned in the function below
double y = Math.floor(8.5);


Other Math functions: Math.ceil() Math.sqrt() Math.sin() Math.cos() Math.round()