JavaScript Tutorial JavaScript Resources
Python Java C++ C C# PHP R SQL DS Algo InterviewQ

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

5