August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.LN2
The LN2 property of the Math object is used to get the natural logarithm of 2. This is approximately equal to 0.693.
Listing 6.162 shows how the LN2 property is used to get the natural logarithm of 2.
<html> <body> <script language="JavaScript"> <!–– Hide // function gets the natural log of 2 function doMath(){ var result = Math.LN2; document.form1.answer.value = result; } // End Hide ––> </script> <form name=form1> The Natural Logarithm of 2 is: <input type="text" name="answer" size=20> <input type="button" value="Calculate" onClick='doMath()'> <br> </form> </body> </html> ... |
Read now
Unlock full access