Math LOG2E Property - Javascript Math

Javascript examples for Math:LOG2E

Description

The LOG2E property returns the base-2 logarithm of E, approximately 1.442.

Return Value:

A Number, representing the base-2 logarithm of E

The following code shows how to return the base-2 logarithm of E:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*w w  w. ja v a 2 s.c  o  m*/
    document.getElementById("demo").innerHTML = Math.LOG2E;
}
</script>

</body>
</html>

Related Tutorials