JavaScript中的Math.log()函数

log()Math对象的函数接受一个数字,并返回给定数字的自然对数(以e为底)。

语法

其语法如下

Math.log(48);

示例

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.log(48);
      document.write("Result: "+result);
   </script>
</body>
</html>

输出结果

Result: 3.8712010109078907