JS案例:求圆周率的4次方

来自CloudWiki
跳转至: 导航搜索
<!doctype html>
<html>
<head>
	<meta chaeset="utf8">
	<title></title>
</head>

<body>
	
	<script type="text/javascript">
		var p,num
		p=Math.PI;
		num =Math.round(Math.pow(p,4));
		alert("圆周率的4次方经过四舍五入取整后的值为:"+num);
	</script>

</body>
</html>