JavaScript LN2 属性


定义和用法

LN2 属性就是 loge2,即 2 的自然对数,其值近似于 0.69314718055994528623。

语法
  1. Math.LN2

实例

返回 2 的自然对数:

  1. <html>
  2. <body>
  3. <script type="text/javascript">
  4. document.write("LN2: " + Math.LN2);
  5. </script>
  6. </body>
  7. </html>

输出:

  1. LN2: 0.6931471805599453

分类导航