• https://me.yahoo.com
COST (GBP)
3.90
0.00
0

# pv

Return the present value of an investment.
Controller: CodeCogs
Contents

C++

## Pv

 doublepv( double rate int n double p double vn PaymentPoint when` = pp_EndOfPeriod` )
This function calculates the present value, v_0, for a sequence of n future payouts p followed by a final payment v_n:

If rate = 0,
$v_0&space;+&space;p\,n&space;+&space;v_n&space;=&space;0$
If rate > 0 and payments are received at the start of each period,
$v_0(1+rate)^n&space;+&space;p_1(1+rate)^{n}&space;+&space;p_2(1+rate)^{n-1}&space;+&space;...&space;+&space;p_{n-1}(1+rate)&space;+&space;v_n&space;=&space;0$
while for payments received at the end of each period
$v_0(1+rate)^n&space;+&space;p_1(1+rate)^{n-1}&space;+&space;p_2(1+rate)^{n-2}&space;+&space;...&space;+&space;p_{n}(1+rate)&space;+&space;v_n&space;=&space;0$

The code also uses an enumerated type PaymentPoint, using the following values:
• pp_EndOfPeriod = 0
• pp_StartOfPeriod = 1.

### Example 1

A lady wins a $\inline&space;10&space;million&space;lottery.&space;&space;The&space;money&space;is&space;to&space;be&space;paid&space;out&space;at&space;the&space;end&space;of&space;each&space;year&space;in$500,000 payments for 20 years. The cu rrent treasury bill rate of 6% is used as the discount rate.
```#include <stdio.h>
#include <codecogs/finance/accounting/pv.h>

int main(int argc, char *argv[])
{
double d = Finance::Accounting::pv(0.06, 20, 500000, 0, Finance::Accounts::pp_EndOfPeriod);
printf("The present value of the \$10 million prize is: %7.2f\n", d);
return 0;
}```
Output:
`The present value of the \$10 million prize is: 5734960.61`

### References

http://www.vni.com/products/imsl/jmsl/v30/api/com/imsl/finance/Finance.html

### Parameters

 rate is the interest rate - assumed constant. n is the number of periods over which to calculate. p are the payouts from the investment made either at the start or end of each period (as defined by when). vn The future value of the investment. when The point in each period when the payment is made, either pp_StartOfPeriod or pp_EndOfPeriod.

### Authors

James Warren (May 2005)
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.

Last Modified: 8 Jul 08 @ 00:41     Page Rendered: 2022-03-14 17:53:23