contents   index   previous   next



Math.log()

syntax:

Math.log(x)

where:

x - a number.greater than zero.

 

return:

number - an implementation-dependent approximation of the natural logarithm of x.

 

description:

If a negative number is passed to Math.log(), the return is NaN

 

example:

//The natural log of x is returned 

//in the following function:

function compute_log(x)

{

   return Math.log(x)

}

//If the argument is less than 0 or NaN, 

//the result is NaN

//If the argument is +0 or -0, 

//the result is -infinity

//If the argument is 1, the result is +0

//If the argument is +infinity, 

//the result is +infinity

 


Math.max()