August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.LOG2E
The LOG2E property of the Math object calculates the base 2 logarithm of Euler's constant. The return value is approximately 1.442.
Listing 6.165 shows how the LOG2E property is used.
<html>
<body>
<script language="JavaScript">
<!–– Hide
function doMath(){
var result = Math.LN2E;
document.form1.answer.value = result;
}
// End Hide ––>
</script>
<form name=form1>
The Base 2 logarithm of Euler's constant is:
<input type="text" name="answer" size=20>
<input type="button" value="Calculate" onClick='doMath()'>
<br>
</form>
</body>
</html>
|
Read now
Unlock full access