JavaScript 中的 Math.log1p() 函数

htmljavascriptweb developmentfront end technology更新于 2024/8/11 21:24:00

Math 对象的 log1p() 函数接受一个数字并返回(给定数字 + 1)的自然对数(底数为 E)。

语法

其语法如下

Math.log1p(48);

示例

<html>
<head>
   <title>JavaScript 示例</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.log1p(48);
      document.write("结果: "+result);
   </script>
</body>
</html>

输出

结果: 3.8918202981106265

相关文章