1//The Math.ceil() function always rounds a
2//number up to the next largest integer.
3
4//Note: Math.ceil(null) returns integer 0
5//and does not give a NaN error.
6
7Math.ceil(.95); // 1
8Math.ceil(4); // 4
9Math.ceil(7.004); // 8
10Math.ceil(-0.95); // -0
11Math.ceil(-4); // -4
12Math.ceil(-7.004); // -7
13
1Math.ceil(x); //This equals the next whole number after x. X must be a double.
2
3//Example use:
4x = Math.ceil(x);
5//Now x is equal to x rounded up.
1Math.ceil(.95); // 1
2Math.ceil(4); // 4
3Math.ceil(7.004); // 8
4Math.ceil(-0.95); // -0
5Math.ceil(-4); // -4
6Math.ceil(-7.004); // -7
7