The JavaScript math function is actually the math object , which includes attributes and functions (or methods) in two parts. Among them, the property mainly has the following content:
MATH.E: E (natural logarithm),math.ln2(natural logarithm of 2),math.ln10(natural logarithm of 10),math.log2e(logarithm of E, base 2), math.log10e (logarithm of E, base 10),Math.PI(π),math.sqrt1_2(square root value of 1/2),math.sqrt2(square root of 2).
The function has the following 18:
(1) ABS function: Math.Abs (the same as below), returns the absolute value of a number.
(2) ACOs function: Returns the inverse cosine of a number with a result of 0~π radians (radians).
(3) ASIN Function: Returns the inverse sine of a number, resulting in-Π/2~Π/2 radians.
(4) atan function: Returns the inverse tangent of a number with the result of-Π/2~Π/2 radians.
(5) atan2 function: Returns the polar coordinate angle value of a coordinate.
(6) ceil function: Returns the smallest integer value (greater than or equal to) of a number.
(7) cos function: Returns the cosine of a number with the result of -1~1.
(8) exp Function: Returns the value of the exponent of E (natural logarithm).
(9) Floor function: Returns the maximum integer value (less than or equal to) of a number.
(10) Log function: A natural logarithm function that returns the natural logarithm (e) value of a number.
(11) Max function: Returns the maximum value of two digits.
(12) min function: Returns the minimum value of two digits.
(13) POW function: Returns the value of a number.
(14) Random function: Returns a 0~1 value.
(15) round function: Returns the rounded value of a number with an integer type.
(16) sin function: Returns the sine of a number with the result of -1~1.
(17) sqrt function: Returns the square root value of a number.
(18) Tan function: Returns the tangent of a number.
The mathematical function of JavaScript