math.pow results not displaying

207 views Asked by At

Trying to get math.pow function to display but it will not. The labels should the answer to 77^39 mod 517, etc.

 <body>
<p><input type="button" value="Encrypt Message" id="encButton"
onClick="encrypt()" name="encButton" /></p>
<p id="encryptResultLabel1"></p>
<p id="encryptResultLabel2"></p>
<p id="encryptResultLabel3"></p>
<p id="encryptResultLabel4">&nbsp</p>
</body>
<script>
function encrypt(){
var g = ((math.pow(77, 39)) % 517);
var h = ((math.pow(65, 39)) % 517);
var j = ((math.pow(84, 39)) % 517);
var k = ((math.pow(73, 39)) % 517);
DisplayResult(g, "encryptResultLabel1");
DisplayResult(h, "encryptResultLabel2");
DisplayResult(j, "encryptResultLabel3");
DisplayResult(k, "encryptResultLabel4");
}
</script>
1

There are 1 answers

0
Saravana Kumar On BEST ANSWER

use Math instead of math.

Refer this link for more detail.

var g = ((Math.pow(77, 39)) % 517);  //output - 21 
var h = ((Math.pow(65, 39)) % 517);  //output - 103
var j = ((Math.pow(84, 39)) % 517);  //output - 210
var k = ((Math.pow(73, 39)) % 517);  //output - 132