Below is the example of the Math LOG2E Property.
- Example:
<script>// Here value of Math.LOG2E is printed.document.write(Math.LOG2E);</script>chevron_rightfilter_none - Output:
1.4426950408889634
The Math.LOG2E is a property in JavaScript which is simply used to find the value of base 2 logarithms of e, where e is an irrational and transcendental number approximately equal to 2.718
Syntax:
Math.LOG2E;
Return Values: It simply return the value of base 2 logarithm of e.
Below example illustrates the Math LOG2E property in JavaScript.
- Example: Here simply value of base 2 logarithm of e is shown as output.
Input : Math.LOG2E Output:1.4426950408889634
More codes for the above property are as follows:
Program 1: Value of base 2 logarithm of e can be printed as in the form of function as shown below.
<script> // function is being called. function get_Value_of_base_2_lagarithm_of_e() { return Math.LOG2E; } // function is calling. document.write(get_Value_of_base_2_lagarithm_of_e()); </script> |
Output:
1.4426950408889634
Program 2: Here we consider Math.LOG2E as a function but in actual it is a property that is why error as output is being shown.
<script> // Here we consider Math.LOG2E as a function but // in actual it is a property that is why error // as output is being shown. document.write(Math.LOG2E(12)); </script> |
Output:
Error: Math.LOG2E is not a function
Program 3: Whenever we need to find the value of base 2 logarithm of e that time we take the help of this property.In mathemaatics it needed a lot.
<script> // Value of Math.LOG2E is printed. document.write(Math.LOG2E); </script> |
Output:
1.4426950408889634
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- JavaScript Math LOG10E Property
- JavaScript Math LN10 Property
- JavaScript Math SQRT1_2 Property
- JavaScript Math PI Property
- JavaScript Math SQRT2 Property
- JavaScript Math LN2 Property
- JavaScript Math cosh() Method
- JavaScript Math random() Method
- JavaScript Math round( ) Method
- JavaScript Math abs( ) Method
- JavaScript Math sqrt( ) Method
- JavaScript Math floor() Method
- JavaScript | Math.ceil( ) function
- JavaScript | Math.round( ) function
- JavaScript Math pow( ) Method
- JavaScript | Math.hypot( ) Function
- JavaScript | Math.fround( ) Function
- JavaScript Math trunc( ) Method
- JavaScript Math exp( ) Method
- JavaScript Math log( ) Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


