Availability
JavaScript
1.0; JScript 1.0; ECMAScript v1
Synopsis
Math.constant
Math.function( )
Constants
Math.E
The constant e the base of the
natural
logarithms.
Math.LN10
The natural logarithm of 10.Math.LN2
The natural logarithm of 2.Math.LOG10E
The base-10 logarithm of e Math.LOG2E
The base-2 logarithm of e Math.PI
The constant
1 divided by the square root of 2.Math.SQRT2
The square root of 2.
Static Functions
Math.abs( )
Computes an absolute
value.
Math.acos( )
Computes an arc cosine.Math.asin( )
Computes an arc sine.Math.atan( )
Computes an arc tangent.Math.atan2( )
Computes the angle from the X-axis to a point.Math.ceil( )
Rounds a number up.Math.cos( )
Computes a cosine.Math.exp( )
Computes an exponent of e Math.floor( )
Rounds a number down.Math.log( )
Computes a natural logarithm.Math.max( )
Returns the larger of two numbers.Math.min( )
Returns the smaller of two numbers.Math.pow( )
Computes xy Math.random( )
Computes a random number.Math.round( )
Rounds to the nearest integer.Math.sin( )
Computes a sine.Math.sqrt( )
Computes a square root.Math.tan( )
Computes a tangent.
Description
Math is an object that defines properties that refer to useful
mathematical functions and constants. These functions and constants
are conveniently grouped by this Math object and are invoked with
syntax like this:
y = Math.sin(x);
area = radius * radius * Math.PI;
Math is not a class of objects like Date and String are. There is no
Math( ) constructor, and functions like
Math.sin( ) are simply functions, not methods that
operate on an object.
See Also
Number
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.