Math对象的log1p()函数接受一个数字,并返回(给定数字+1)的自然对数(以E为底)。
其语法如下
Math.log1p(48);
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.log1p(48);
document.write("Result: "+result);
</script>
</body>
</html>输出结果
Result: 3.8918202981106265