MathA class is a mathematical tool class that contains methods for performing basic mathematical operations, such as elementary exponents, logarithms, square roots, and trigonometric functions.
A tool class like this, all of its methods are static methods, and generally do not create objects. such as the System class
A tool class that represents a class that can perform a series of functions without creating an object when using them, and the method in that class is a static method
Common methods
Abs method, the result is positive double D1 = Math.Abs (-5); The value of D1 is 5double d2 = Math.Abs (5); The value of D2 is the 5ceil method, and the result is a double value of the smallest integer greater than the value of the parameter double D1 = Math.ceil (3.3); The value of D1 is 4.0double d2 = Math.ceil (-3.3); The value of D2 is -3.0double d3 = Math.ceil (5.1); The value of D3 is the 6.0floor method, and the result is a double value of the largest integer that is smaller than the value of the parameter double D1 = Math.floor (3.3); The value of D1 is 3.0double d2 = Math.floor (-3.3); The value of D2 is -4.0double d3 = Math.floor (5.1); The value of D3 is the 5.0max method, which returns a large value of two parameter values double d1 = Math.max (3.3, 5.5); The value of D1 is 5.5double d2 = Math.max (-3.3,-5.5); The value of D2 is the -3.3min method, which returns the lower value of two parameter values in double D1 = math.min (3.3, 5.5); The value of D1 is 3.3double d2 = Math.max (-3.3,-5.5); The value of D2 is the -5.5pow method, which returns the value of the second parameter of the first argument to the power of double D1 = Math.pow (2.0, 3.0); The value of D1 is 8.0double d2 = Math.pow (3.0, 3.0); The value of D2 is the 27.0round method, which returns the result of rounding the parameter value double d1 = Math.Round (5.5); The value of D1 is 6.0double d2 = Math.Round (5.4); The value of D2 is a 5.0random method that produces a double D1 = Math.random () that is greater than or equal to 0.0 and less than 1.0.
Java-math class