August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.E
The E property of the Math object is used to get the value of Euler's constant. This is approximately 2.718.
Listing 6.158 shows how the E property is used.
<html>
<body>
<script language="JavaScript">
<!–– Hide
// function to return Euler's constant
function doMath(){
var result = Math.E;
document.form1.answer.value = result;
}
// End Hide ––>
</script>
<form name=form1>
Click on the button to get Euler's constant.
<br><br>
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