H I O X INDIA
Javascript Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java-Script Tutorial
Introduction
Variables
Operators
Statements
Loops
Functions
Objects
Arrays
Browser Objects
Form DOM
Ask Your Doubts
Feedback





Math Object Constants


Topic

How to get the value of constants like PI, Eulers in javascript?



Explanation

Object: Math Variables

Math object has the following variables that give the values of constants like PI, logarithm, Eulers, etc..

ConstantExample CodeResultDescription
E Math.E; Math.E returns the Eulers constant.
LN2 Math.LN2; Math.LN2 returns the value of natural logarithm of base 2.
LN10 Math.LN10; Math.LN10 returns the constant value of natural logarithm to the base 10.
LOG2E Math.LOG2E; Math.LOG2E returns the logarithmic value of E to the base 2.
LOG10E Math.LOG10E; Math.LOG10E returns the logarithmic value of E to the base 10.
PI Math.PI; Math.PI returns the value of constant PI.
SQRT1_2 Math.SQRT1_2; Math.SQRT1_2 returns the Square Root of 0.5.
SQRT2 Math.SQRT2; Math.SQRT2 returns the value of Square Root of 2.


        Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

others

privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links