JavaScript Tutorial JavaScript References

JavaScript - Math.LN2 Property



The JavaScript Math.LN2 property is the natural logarithm of 2. It is approximately 0.693.

Syntax

Math.LN2

Example:

The example below shows the usage of Math.LN2 property.

var txt;

txt = "Math.LN2 = " + Math.LN2 + "<br>";
txt = txt + "Math.exp(Math.LN2) = " + Math.exp(Math.LN2) + "<br>";
txt = txt + "Math.LN2 / Math.log(2) = " + Math.LN2 / Math.log(2) + "<br>";

The output (value of txt) after running above script will be:

Math.LN2 = 0.6931471805599453
Math.exp(Math.LN2) = 2
Math.LN2 / Math.log(2) = 1

❮ JavaScript - Math Object