Math LN2 Property - Javascript Math

Javascript examples for Math:LN2

Description

The LN2 property returns the natural logarithm of 2, approximately 0.693.

Return Value:

A Number, representing the natural logarithm of 2

The following code shows how to return the natural logarithm of 2:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials