Javascript Math Object Properties

by top54u.com 21 Jul, 2008

Javascript Math object also provides some properties along with Math functions. Javascript Math object properties return the constant values for Math constants such as Pi or Euler’s constant. Math object properties return pre calculated values also e.g.: natural Log value of 2 or 10. Following are the Javascript Math object properties:

 

Math.E: returns the value of Euler’s constant. (2.718281828459045)

 

Math.LN10: returns the natural log of 10. (2.302585092994046)

 

Math.LN2: returns the natural log of 2. (0.6931471805599453)

 

Math.LOG10E: returns the base-10 log of E. (0.4342944819032518)

 

Math.LOG2E: returns the base-2 log of E. (1.4426950408889633)

 

Math.PI: returns the constant value of PI. (22/7 = 3.141592653589793)

 

Math.SQRT1_2: returns the value of square root of ½. (0.7071067811865476)

 

Math.SQRT2: returns the square root of 2. (1.4142135623730951)

 

Above Javascript Math properties return the predefined values for the constants like Pi and E. Other properties like LOG10E, LN10, SQRT2 provides the pre calculated values that reduces the code length by eliminating the logical code for deriving the values each time when they are required. You can directly use these Javascript Math object properties.

Click here to learn Javascript Math Functions.

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , , , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

10/11/2008 3:21:19 AM




related videos.....
recent posts.....
top54u ezines.....