Return the net present value of an investment.

View versions (2)

Interface

#include <codecogs/finance/accounting/npv.h>

using namespace Finance::Accounting;

This function calculates the net present value of an investment. It returns the net present value of a stream of equal periodic cash flows, which are subject to a given discount rate.

Parameters

rate
The interest rate
value
An array of values
nV
The number of values (entries in the array)

Returns

The net present value of the given cash flow series, discounted at rate, assuming the first cash flow (value[0]) occurs one period from now.
GPL Licence — free for non commercial use. See Licence details.