返回 e 的给定数值表示多少次幂。
语法
用法
result = Exp( number )
参数
返回值
说明
数学常数
e 也称为欧拉常数,是
Exp和
Log的基础,是一个非理性和超越性的数字。
e 取数据值为二十个重要数字:
2.7182818284590452354.所需的
number 参数可以是函数范围内的任何有效的数字表达式。如果
number 太大,
Exp返回无限远。如果
number 太小,
Exp将返回零(
0.0)。如果
number 为零,则返回
1.0.
number 的确切限制是基于数学处理器。
例子
'计算连续复利
Dim r As Double
Dim p As Double
Dim t As Double
Dim a As Double
Input "请输入初始投资(本金):"; p
Input "请输入年利率(十进制):"; r
Input "请输入投资年限:"; t
a = p * Exp ( r * t )
Print ""
Print "后";t;"年,以利率计算"; r * 100; "%,你的初始投资"; p; "值得的";a
输出将如下所示:
Please enter the initial investment (principal amount): 100
Please enter the annual interest rate (As a decimal): .08
Please enter the number of years To invest: 20
After 20 years, at an interest rate of 8%, your initial investment of 100 would be worth 495.3032424395115
与QB差别
参考