Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

JavaScript: Power Function



pow function:
Returns base to the exponent power, that is, baseexponent .
Calculate x raised to y (xy)

Syntax:
pow(x,y)
x is the base number and y is the exponent to which to raise base.

Description:
Because pow is a static method of Math, you always use it as Math.pow(), rather than as a method of a Math object you created.



Example:

<html>
<head>
<title>Power Function</title>

<script language="javascript">
document.write("calculate 5 <sup> 2 </sup> = " + Math.pow(5,2) + "<br>");
document.write("calcuclate 3 <sup> 5 </sup> = " + Math.pow(3,5) + "<br>");
</script>

</head>
</html>



OUTPUT:

calculate 52 = 25
calcuclate 35 = 243

1 comment:

  1. Golden Nugget Casino, Tunica - Mapyro
    Directions to Golden Nugget 의왕 출장샵 Casino, Tunica 태백 출장샵 (Mapyro) 정읍 출장안마 with public transportation. 순천 출장마사지 The following transit lines have 통영 출장마사지 routes that pass near Golden Nugget

    ReplyDelete

Google