On this page本页内容
$ln
¶New in version 3.2.版本3.2中的新功能。
Calculates the natural logarithm ln (i.e loge) of a number and returns the result as a double.计算一个数字的自然对数ln
(即loge),并以双精度返回结果。
$ln
has the following syntax:语法如下所示:
The <number>
expression can be any valid expression as long as it resolves to a non-negative number. <number>
表达式可以是任何有效的表达式,只要它解析为非负数。For more information on expressions, see Expressions.有关表达式的详细信息,请参阅表达式。
$ln
is equivalent to 相当于$log: [ <number>, Math.E ]
expression, where Math.E
is a JavaScript representation for Euler’s number e.$log: [ <number>, Math.E ]
表达式,其中Math.E
是欧拉的数字e的JavaScript表示。
If the argument resolves to a value of 如果参数解析为null
or refers to a field that is missing, $ln
returns null
. null
值或引用缺少的字段,$ln
返回null
。If the argument resolves to 如果参数解析为NaN
, $ln
returns NaN
.NaN
,$ln
返回NaN
。
{ $ln: 1 } |
0 |
{ $ln: Math.E } Math.E is a JavaScript representation for e.Math.E 是e的JavaScript表示。 |
1 |
{ $ln: 10 } |
2.302585092994046 |