libstatcalc.cpp
// NPV - Net present value of a regularly spaced series of cash flows
Net present value of a regularly spaced series of cash flows
Net present value of a regularly spaced series of cash flows
double NPV(double rate, double * parray, int size) {
	double sum = 0.0;
	register int i;
	for (i = 0; i < size; i++) {
		sum += (parray[i] / pow((1 + rate), i + 1));
	}
	return sum;
}
double NPV ( double rate , double * parray , int size ) { double sum = 0.0 ; register int i ; for ( i = 0 ; i < size ; i ++ ) { sum += ( parray [ i ] / pow ( ( 1 + rate ) , i + 1 ) ) ; } return sum ; }
NPV - Net present value of a regularly spaced series of cash flows
NPV - Net present value of a regularly spaced series of cash flows