1. Discard the fractional part and retain the integer part.
ParseInt (5/2)
2. rounded up. If there is a decimal number, add 1 to the integer part.
Math. ceil (5/2)
3. rounding.
Math. round (5/2)
4. Round down
Math. floor (5/2)
Math object Method
FF: Firefox, N: Netscape, IE: Internet Explorer
Method description FF N IE
Abs (x) returns the absolute value of the number 1 2 3
Acos (x) returns the inverse cosine of numbers 1 2 3
Asin (x) returns the inverse sine value of the number 1 2 3
Atan (x) returns the arc tangent of x with a value between-PI/2 and PI/2 radian. The value is 1 2 3.
Atan2 (y, x) returns the angle (between-PI/2 and PI/2 radian) from the x-axis to the point (x, y). 1 2 3
Ceil (x) rounds up a number. 1 2 3
Cos (x) returns the cosine of the number 1 2 3
Exp (x) returns the e index. 1 2 3
Floor (x) is used to remove a number. 1 2 3
Log (x) returns the natural logarithm of the number (Base e) 1 2 3
Max (x, y) returns the highest value of 1 2 3 in x and y.
Min (x, y) returns the minimum value of 1 2 3 in x and y.
Pow (x, y) returns x's y power 1 2 3
Random () returns 0 ~ Random number between 1 1 2 3
Round (x) rounds a number to the nearest integer 1 2 3.
Sin (x) returns the sine of the number 1 2 3
Sqrt (x) returns the square root of the number 1 2 3
Tan (x) returns the tangent of an angle 1 2 3
ToSource () indicates the source code of the object 1 4-
ValueOf () returns the original value of a Math object.