EXP (Azure Cosmos DB)EXP (Azure Cosmos DB)

返回指定数值表达式的指数值。Returns the exponential value of the specified numeric expression.

语法Syntax

EXP (<numeric_expr>)  

参数Arguments

numeric_exprnumeric_expr
为数值表达式。Is a numeric expression.

返回类型Return types

返回数值表达式。Returns a numeric expression.

备注Remarks

常量 e (2.718281…) 是自然对数的底数eThe constant e (2.718281…), is the base of natural logarithms.

数字的指数是常量 e 使用该数字进行幂运算 。The exponent of a number is the constant e raised to the power of the number. 例如 EXP(1.0) = e^1.0 = 2.71828182845905,EXP(10) = e^10 = 22026.4657948067。For example, EXP(1.0) = e^1.0 = 2.71828182845905 and EXP(10) = e^10 = 22026.4657948067.

某个数的自然对数的指数就是该数本身:EXP (LOG (n)) = n。The exponential of the natural logarithm of a number is the number itself: EXP (LOG (n)) = n. 并且某个数的指数的自然对数也是该数本身:LOG (EXP (n)) = n。And the natural logarithm of the exponential of a number is the number itself: LOG (EXP (n)) = n.

示例Examples

以下示例声明一个变量并返回到指定变量 (10) 的指数值。The following example declares a variable and returns the exponential value of the specified variable (10).

SELECT EXP(10) AS exp  

下面是结果集:Here is the result set.

[{exp: 22026.465794806718}]  

以下示例将返回 20 的自然对数的指数值以及 20 的指数的自然对数。The following example returns the exponential value of the natural logarithm of 20 and the natural logarithm of the exponential of 20. 由于这些函数互为反函数,因此在这两种情况下,用于浮点数学舍入的返回值均为 20。Because these functions are inverse functions of one another, the return value with rounding for floating point math in both cases is 20.

SELECT EXP(LOG(20)) AS exp1, LOG(EXP(20)) AS exp2  

下面是结果集:Here is the result set.

[{exp1: 19.999999999999996, exp2: 20}]  

后续步骤Next steps