Math.pow

べき乗を得る

構文

Math.pow(x,y)

引数

x=基数, y=指数

例文

<html>
<head>
<title>Math.pow</title>
</head>

<body>

<!--べき乗を得るのサンプル-->
<script type="text/javascript">
document.write('0の0乗は'+Math.pow(0,0)+"です<br>");
document.write('0の1乗は'+Math.pow(0,1)+"です<br>");
document.write('1の1乗は'+Math.pow(1,1)+"です<br>");
document.write('1の10乗は'+Math.pow(1,10)+"です<br>");
document.write('2の3乗は'+Math.pow(2,3)+"です<br>");
document.write('-2の3乗は'+Math.pow(-2,3)+"です<br>");
document.write('2の4乗は'+Math.pow(2,4)+"です<br>");
document.write('-2の4乗は'+Math.pow(-2,4)+"です<br>");
</script>

</body>
</html>

関連記事

スポンサーリンク

トラックバックの仕様

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る