Package Com.etc.usual;public class Testmath {public static void main (string[] args) {//TODO auto-generated method stub//Word Segment Summary System.out.println (MATH.PI);//3.141592653589793system.out.println (MATH.E); 2.718281828459045//abs System.out.println ("Math.Abs ( -100):" +math.abs ( -100));//math.abs ( -100): 100//CBRT (double A) returns the cube root of the double value. System.out.println ("MATH.CBRT (8.0):" +MATH.CBRT (8)),//MATH.CBRT (8.0): 2.0//ceil (Double A) returns the smallest (nearest negative infinity) Double value, The value is greater than or equal to the parameter and equals an integer. System.out.println ("Math.ceil (1.3):" +math.ceil (1.3)); Math.ceil (1.3): 2.0//floor (Double A) returns the largest (closest to positive infinity) Double value, which is less than or equal to the parameter and equals an integer. System.out.println ("Math.floor (1.3):" +math.floor (1.3));//math.floor (1.3): 1.0//max (int a, int b) returns two int The larger of a System.out.println ("Math.max (5,20):" +math.max (5,20)),//math.max (5,20): 20//nested System.out.println (Math.max (Math.max (5,11), 20)); /20//min (int a, int b) returns the smaller of the two int values. System.out.println ("Math.min (5,20):" +math.min (5,20));//math.min (5,20): 5//pow (Double A, double b) Returns the value of the second argument to the power of the first parameter. System. Out.println ("Math.pow (2,3):" +math.pow (2,3)),//2 3-time Math.pow (2,3): 8.0//random () returns a double with a positive number, which is greater than or equal to 0.0 and less than 1.0. System.out.println ("Math.random ():" +math.random ());//math.random (): 0.9297624078518352//round (Double A) returns the nearest parameter Long System.out.println ("Math.Round (1.3):" +math.round (1.3));//math.round (1.3): 1system.out.println ("Math.Round (1.5): "+math.round (1.5));//math.round (1.5): 2}}
Java.lang.Math