First, the Math class
Java.lang.Math provides a series of static methods for scientific calculation, and the parameters and return value types of the methods are generally double 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 integers of arbitrary precision.
① Constructors
BigInteger (String val)
Common methods
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 double class can be used for scientific calculation or engineering calculation, but in commercial calculation, it is required that the digital precision is higher, so it is used in the Java.math.BigDecimal class. The BigDecimal class supports fixed-point numbers of any precision.
Constructors
Public BigDecimal (double val)
Public BigDecimal (String val)
Common methods
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