它返回圆的周长与其直径的比值,约为3.14159。
PI - 语法
Math.PI
PI - 示例
<html> <head> <title>JavaScript Math PI Property</title> </head> <body> <script type="text/javascript"> var property_value=Math.PI document.write("Property Value is : " + property_value); </script> </body> </html>
运行上面代码输出
Property Value is : 3.141592653589793