Math Class (ceil, floor, abs)

Math class is part of java.lang package and provides basic mathematical operations as shown in the example below:

Code:

`double aNumber = -123.234;`

System.out.println("The absolute value of " + aNumber + " is " + Math.abs(aNumber));

System.out.println("The ceiling of " + aNumber + " is " + Math.ceil(aNumber));

System.out.println("The floor of " + aNumber + " is " + Math.floor(aNumber));

Output:

Code:

`The absolute value of -123.234 is 123.234`

The ceiling of -123.234 is -123.0

The floor of -123.234 is -124.0