First, the Math class
Java.lang.Math provides a series of static methods for scientific calculations, and its methods are generally double in terms of the number of parameters and the return value type.
ABS Absolute
Acos,asin,atan,cos,sin,tan Trigonometric Functions
sqrt square root
Pow (double a,doble b) a power of B
Log Natural logarithm
Exp e is the base index
Max (double a,double b)
Min (double a,double b)
Random () returns the number 0.0 to 1.0
Long round (double a) double type data A is converted to long (rounded)
Todegrees (double angrad) radians-angle
Toradians (double angdeg) angle, radians
Second, BigInteger class
Integer class as the wrapper class of int, the maximum integer value that can be stored is the numeric range of the 2^31-1,biginteger class than the number of the integer class
The range is much larger and can support arbitrary precision integers.
① Constructors
BigInteger (String val)
Frequent usage
Public BigInteger ABS ()
Public BigInteger Add (BigInteger val)
Public BigInteger Subtract (BigInteger val)
Public BigInteger Multiply (BigInteger val)
Public BigInteger Divide (BigInteger val)
Public BigInteger remainder (BigInteger val)
Public BigInteger pow (int exponent)
Public biginteger[] Divdeandremainder (BigInteger val)
Third, BigDecimal class
The General float class and the double class can be used for scientific calculations or project calculations. However, in the commercial calculation, it is required that the digital precision is higher, so the Java.math.BigDecimal class is used. The BigDecimal class supports fixed-point numbers regardless of precision.
Constructors
Public BigDecimal (double val)
Public BigDecimal (String val)
Frequent usage
Public BigDecimal Add (BigDecimal augend)
Public BigDecimal Subtract (BigDecimal subtrahend)
Public BigDecimal Multiply (BigDecimal multiplicand)
Public BigDecimal Divide (BigDecimal divisor, int scale, int roundingmode)
Java's Math