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…
취소
저장