JavaScript中使用Math.PI圆周率属性的方法

内容摘要
这将返回一个圆到其直径的圆周的比率,大约3.14159.

语法


Math.PI



例子:


<html>
<head>
<title>JavaScript Math PI Property</title>
</head>
<body>
<script type="
文章正文

 这将返回一个圆到其直径的圆周的比率,大约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 


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!