JavaScript中的Math.PI属性
Math对象的PI属性表示pi的值(圆周的比和圆的直径)。
语法
其语法如下
Math.PI
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.PI;
document.write(result);
</script>
</body>
</html>输出结果
3.141592653589793