Introduction to using JavaScript Math. ceil () Functions
Math. ceil (x) -- returns the smallest integer greater than or equal to the number parameter (take the entire function) and rounds up the number. The following is a good example. If you are interested, refer
Math. ceil (x) -- returns the smallest integer greater than or equal to the number parameter (take the entire function) and rounds the number up.
Ceil is short for ceiling. It refers to "upper limit" in Chinese.
URL: http://www.dreamdu.com/javascript/Math.ceil/
Ceil function syntax
Math. ceil (x );
Ceil function parameters
X -- number of The number type
Ceil function return value
Returns the smallest integer greater than or equal to x.
Ceil function example
File. write (Math. ceil (5.99 ));
Document. write (Math. ceil (-5.99 ));
File. write (Math. ceil (1.01 ));
Document. write (Math. ceil (-1.01 ));
Result:
6
-5
2
-1