Math Class
Package: java.lang
Provides builtin methods that perform a wide variety of mathematical calculations, including
Basic functions, such as calculating an absolute value or a square root
Trigonometry functions, such as sin and cos
Practical functions, such as rounding numbers or generating random numbers
Fields
The Math
class provides to static fields that define frequently used mathematical constants.
Field 
What It Is 
Value 

The base of natural logarithms 
2.718281828459045 

The constant pi (π), the ratio of a circle’s radius and diameter 
3.141592653589793 
Note that these constants are only approximate values because both π and e are irrational numbers.
Here’s an example of a statement that calculates the circumference of a circle:
double diameter = 4;
double circumference = Math.PI * diameter;
Functions
All the methods of the Math
class are declared as static methods.
Method 
Explanation 

Returns the absolute value of the argument. The argument can be an 

Returns the cube root of ... 
Get Java For Dummies Quick Reference now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.