EchoEcho.Com Homepage
Web Hosting - As Reliable As It Gets!
   Home > References > JavaScript > Math Object


 Tutorials 
 D-Zine Articles 
 Online Tools 
 Free Resources 
 References 
 Quiz 
 Hosting 

















  JavaScript Objects :
MATH OBJECT








Core ObjectNNIEECMA
 Math Object with math functionality and constants.2+3+ECMA 1
 
MethodsNNIEECMA
 abs() Returns the absolute value of a number.2+3+ECMA 1
 acos() Returns the arccosine (in radians) of a number. 2+3+ECMA 1
 asin() Returns the arcsine (in radians) of a number. 2+3+ECMA 1
 atan() Returns the arctangent (in radians) of a number.2+3+ECMA 1
 atan2() Returns the arctangent of the quotient of its arguments.2+3+ECMA 1
 ceil() Returns the smallest integer greater than or equal to a number.2+3+ECMA 1
 cos() Returns the cosine of a number.2+3+ECMA 1
 exp() Returns e (the base of natural logarithms) raised to a power. 2+3+ECMA 1
 floor() Returns the largest integer less than or equal to a number.2+3+ECMA 1
 log() Returns the natural logarithm (base E) of a number.2+3+ECMA 1
 max() Returns the greater of two numbers.2+3+ECMA 1
 min() Returns the lesser of two numbers.2+3+ECMA 1
 pow() Returns the value of a base expression taken to a specified power.2+3+ECMA 1
 random() Returns a pseudo random number between 0 and 1.2+3+ECMA 1
 round() Returns the value of a number rounded to the nearest integer.2+3+ECMA 1
 sin() Returns the sine of a number.2+3+ECMA 1
 sqrt() Returns the square root of a number.2+3+ECMA 1
 tan() Returns the tangent of a number.2+3+ECMA 1
 
PropertiesNNIEECMA
 E Euler's constant, approximately 2.718.2+3+ECMA 1
 LN2 Natural logarithm of 2, approximately 0.693.2+3+ECMA 1
 LN10 Natural logarithm of 10, approximately 2.302.2+3+ECMA 1
 LOG2E Base 2 logarithm of E, approximately 1.442.2+3+ECMA 1
 LOG10E Base 10 logarithm of E, approximately 0.434.2+3+ECMA 1
 PI The value of PI, approximately 3.14159.2+3+ECMA 1
 SQRT1_2 Square root of 1/2, approximately 0.707.2+3+ECMA 1
 SQRT2 Square root of 2, approximately 1.414.2+3+ECMA 1





 Math Core object 
 Object with math functionality and constants.
 
Syntax:

Syntax 1
  Math.property(value)


Syntax 2
  Math.method(value)

 
Browser support:
 Microsoft Internet Explorer: 3+
 Netscape Browser: 2+
 
Implementations:
 JavaScript 1.0 (by Netscape)
 JScript 1 (by Microsoft)
 ECMA Script 1 (ECMA Standard)
 
 
Example:

Example :

  alert('The square root of 4 is: '+Math.sqrt(4));



















DEVELOPER TIP!
FACT:
Table widths are MINIMUM settings in HTML. Therefore they sometimes span wider than you wanted.
TIP:
Enclose the table within another table. This ensures that the inner table does not stretch beyond the minimum size defined for the outer table.





     "Better Than Books - As Easy As It Gets!"


On EchoEcho: D-Zine Articles | Tutorials | Online Tools | Free Resources | References | Quiz | HostingAbout EchoEcho