August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.pow(num1, num2)
The pow() method of the Math object is used to calculate an exponent power.
Listing 6.169 shows how the pow() method is used.
<html> <body> <script language="JavaScript"> <!–– Hide // function takes two numbers and calculates the // exponential power. function doMath(){ var inputNum1=document.form1.input1.value; var inputNum2=document.form1.input2.value; var result = Math.pow(inputNum1, inputNum2); document.form1.answer.value = result; } // End Hide ––> </script> <form name=form1> Enter Base number: <input type="text" name="input1" size=10> <br> Enter exponent ... |
Read now
Unlock full access