How to get the value of constants like PI, Eulers in javascript?
Constant | Example Code | Result | Description |
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. |