【发布时间】:2020-05-27 05:24:24
【问题描述】:
我正在做一个项目,其中我们有三个变量,需要创建一个解决连续复利的函数:
三个变量分别是:
- 原理
- 年利率
- 年数
我目前的功能是:
function compoundInterest(balance, interest, years) {
balance *= Math.pow(Math.E, (1 + interest) * years);
return balance;
}
我需要遵循维基百科中的这个公式:
P(t)=P{0}e^{rt}
【问题讨论】:
-
问题是什么?
标签: javascript math