1. Discard the decimal part and keep the integer part
Parseint (5/2)
2. Take up upwards, and add a decimal to the integer part to add 1
Math.ceil (5/2)
3, four houses and five enters.
Math.round (5/2)
4, take down
Math.floor (5/2)
MATH object method
FF: FIREFOX, N: Netscape, IE: Internet Explorerr
Method description FF N IE
ABS (X) The absolute value of the number of returns 1 2 3
ACOS (X) return number of anti -residual string value 1 2 3
ASin (x) The rejection of the number of returned numbers 1 2 3
Atan (x) is based on the value between-pi/2 and Pi/2 arc to return to X's cut value 1 2 3 anyway
ATAN2 (y, x) returns the angle from x axis to point (x, y) (between -PI/2 and Pi/2 arc) 1 2 3
CEIL (x) is given up to a number. 1 2 3
COS (X) Returns the number of Yu String 1 2 3
EXP (X) returns the index of E. 1 2 3
Floor (x) is settled in one number. 1 2 3
Log (x) returned number of natural pairs (bottom E) 1 2 3
Max (x, y) Return to the maximum value of x and y 1 2 3
min (x, y) Return to the minimum value of x and y 1 2 3
POW (x, y) Return to X's Y second power 1 2 3
Random () Return the random number 1 2 between 0 ~ 1
Round (x) incorporates one of the four houses and five as the closest integer 1 2 3
Sin (x) returned sine 1 2 3
SQRT (X) The square root 1 2 3
tan (x) Returns a corner positive cut 1 2 3
TOSOURCE () The source code of the representative object 1 4-
Valueof () returns the original value of a math object