August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.exp(num)
The exp() method of the Math object is used to calculate an exponent where the base is Euler's constant (the base of the natural logarithms).
Listing 6.159 shows how the exp() method is used to calculate an exponential value using the number input by the user.
<html> <body> <script language="JavaScript"> <!–– Hide // function doMath calculates exponential value function doMath(){ var inputNum=document.form1.input.value; var result = Math.exp(inputNum); document.form1.answer.value = result; } // End Hide ––> </script> <form name=form1> Enter First Number: <input type="text" ... |
Read now
Unlock full access