JavaScript – Math PI属性
描述
它返回一个圆的周长与其直径的比值,约为3.14159。
语法
其语法如下:
Math.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 
极客教程