# JavaScript Math Object Reference

Math Object Methods
FF: Firefox, N: Netscape, IE: Internet Explorer Method abs(x) acos(x) asin(x) atan(x) atan2(y,x) Description FFNIE Returns the absolute value of a number 1 23 Returns the arccosine of a number 1 23 Returns the arcsine of a number 1 23 Returns the arctangent of x as a numeric 1 2 3 value between -PI/2 and PI/2 radians Returns the angle theta of an (x,y) point as1 2 3 a numeric value between -PI and PI radians Returns the value of a number rounded 1 23 upwards to the nearest integer Returns the cosine of a number 1 23 x Returns the value of E 1 23 Returns the value of a number rounded 1 23 downwards to the nearest integer Returns the natural logarithm (base E) of a 1 2 3 number Returns the number with the highest value 1 2 3 of x and y Returns the number with the lowest value 1 2 3 of x and y Returns the value of x to the power of y 1 23 Returns a random number between 0 and 1 2 3 1 Rounds a number to the nearest integer 1 23 Returns the sine of a number 1 23 Returns the square root of a number 1 23 Returns the tangent of an angle 1 23

ceil(x) cos(x) exp(x) floor(x) log(x) max(x,y) min(x,y) pow(x,y) random() round(x) sin(x) sqrt(x) tan(x)

toSource() valueOf()

Represents the source code of an object Returns the primitive value of a Math object

1 41 24

Math Object Properties
Property constructor E LN2 LN10 LOG2E LOG10E PI prototype SQRT1_2 SQRT2 Description FFNIE A reference to the function that created 1 24 the object Returns Euler's constant (approx. 2.718) 1 2 3 Returns the natural logarithm of 2 1 23 (approx. 0.693) Returns the natural logarithm of 10 1 23 (approx. 2.302) Returns the base-2 logarithm of E (approx. 1 2 3 1.414) Returns the base-10 logarithm of E 1 23 (approx. 0.434) Returns PI (approx. 3.14159) 1 23 Allows you to add properties and methods 1 2 4 to the object Returns the square root of 1/2 (approx. 1 23 0.707) Returns the square root of 2 (approx. 1 23 1.414)

Sign up to vote on this title