JavaScript 中的 Math.SQRT2 属性

htmljavascriptweb developmentfront end technology

Math 对象的 SQRT2 属性表示 2 的平方根。

语法

其语法如下

Math.SQRT2

示例

<html>
<head>
   <title>JavaScript 示例</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.SQRT2;
      document.write(result);
   </script>
</body>
</html>

输出

1.4142135623730951

相关文章