Mega Code Archive

 
Categories / JavaScript DHTML / Javascript Objects
 

Math functions

Math                  Description Methods  abs(x)                Returns the absolute value of x.  acos(x)               Returns the arc cosine of x in radians.  asin(x)               Returns the arc sine of x in radians.  atan(x)               Returns the arc tangent of x in radians.  atan2(y,x)            Returns the arc tangent of the quotient of its Arguments, that is, y/x.  ceil(x)               Returns the smallest integer greater than or equal to x.  cos(x)                Returns the cosine of x.  exp(x)                Returns ex, where x is the Argument and e is Euler's constant.  floor(x)              Returns the largest integer less than or equal to x.  log(x)                Returns the natural logarithm (base E) of x.  max(x,y)              Returns the greater of the two numbers x and y.  min(x,y)              Returns the lesser of the two numbers x and y.  pow(x,y)              Returns xy, traditionally base to the exponent power, that is, baseexponent.  random()              Returns a pseudo-random number between 0 and 1.  round(x)              Returns the value of x rounded to the nearest integer with .50 as cutoff.  sin(x)                Returns the sine of x.  sqrt(x)               Returns the square root of x.  tan(x)                Returns the tangent of x.