这将返回一个圆到其直径的圆周的比率,大约3.14159.
语法
1 Math.PI例子:
1 2 3 4 5 6 7 8 9 10 11 <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>这将产生以下结果:
1 Property Value is : 3.141592653589793