Javascript examples for Math:LN2
The LN2 property returns the natural logarithm of 2, approximately 0.693.
A Number, representing the natural logarithm of 2
The following code shows how to return the natural logarithm of 2:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* ww w. ja v a 2 s .c om*/ document.getElementById("demo").innerHTML = Math.LN2; } </script> </body> </html>