contents   index   previous   next



Math.ceil()

syntax:

Math.ceil(x)

where:

x - any number or numeric expression.

 

return:

number - the smallest number that is not less than the argument and is equal to a mathematical integer.

 

description:

If the argument is already an integer, the result is the argument itself. Returns NaN if x cannot be converted to a number.

 

example:

//The smallest number that is 

//not less than the argument and is

//equal to a mathematical integer is returned 

//in the following function:

function compute_small_arg_eq_to_int(x)

{

   return Math.ceil(x)

}

 


Math.cos()