瀏覽代碼

Merge baa0296f78 into 48a69cd5df

undefined
Bhanu Sharma 1 月之前
父節點
當前提交
a4742be4b7
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4
    6
      poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java

+ 4
- 6
poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java 查看文件

@@ -117,12 +117,10 @@ public final class FinanceLib {
*/
public static double npv(double r, double[] cfs) {
double npv = 0;
double r1 = r + 1;
double trate = r1;
for (double cf : cfs) {
npv += cf / trate;
trate *= r1;
}
for (int i=0;i<arr.length;i++)
{
npv+=cfs[i]/Math.pow(1+r,i);
}
return npv;
}


Loading…
取消
儲存