On this page本页内容
$exp¶New in version 3.2.版本3.2中的新功能。
Raises Euler’s number (i.e. e ) to the specified exponent and returns the result.将欧拉数(即e)提高到指定的指数并返回结果。
$exp has the following syntax:语法如下所示:
The <exponent> expression can be any valid expression as long as it resolves to a number. <exponent>表达式可以是任何有效的表达式,只要它解析为一个数字。For more information on expressions, see Expressions.有关表达式的详细信息,请参阅表达式。
If the argument resolves to a value of 如果参数解析为null or refers to a field that is missing, $exp returns null. null值或引用缺少的字段,$exp返回null。If the argument resolves to 如果参数解析为NaN, $exp returns NaN.NaN,$exp返回NaN。
{ $exp: 0 } |
1 |
{ $exp: 2 } |
7.38905609893065 |
{ $exp: -2 } |
0.1353352832366127 |
A collection named 名为accounts contains the following documents:accounts的集合包含以下文档:
The following example calculates the effective interest rate for continuous compounding:以下示例计算连续复利的实际利率:
The operation returns the following results:操作返回以下结果: