6.2.3 The Math class

Previous Index Next 


 
The Math class provides a series of method for performing mathematical functions some of these methods are detailed below. For a full list look at the Java API documentation.
 
 
E This attribute holds the double value that is the closest to e the base of the natural logarithms. 
PI This attributes holds the double value that is the closest to pi the ratio of the circumference of a circle to its diameter.
abs This method returns the absolute value of the number passed to it.
acos Returns the arc cosine of the specified angle.
asin Returns the arc sine of the specified angle.
atan Returns the arc tangent of the specified angle.
log Returns the natural log of the number specified.
cos Returns the trigonometric cosine of an angle. 
max Returns the greater of the two numbers passed to it.
min Returns the smaller of the two numbers passed to it.
pow Returns of value of the first argument raised to the power of the second argument. 
random Returns a random number between 0.0 and 1.0.
round Rounds off the specified number to the nearest whole number.
sin Returns the trigonometric sine of an angle. 
sqrt Returns the square root of the number specified.
tan Returns the trigonometric tangent of an angle. 
 



Source  
  1