Bhanu Sharma 1 mês atrás
pai
commit
a4742be4b7
Nenhuma conta vinculada ao e-mail do autor do commit

+ 4
- 6
poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java Ver arquivo

@@ -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;
}


Carregando…
Cancelar
Salvar