Time within a period when a payment is made

You're viewing an older version of this page (#265). View the current version.

View versions (1)

Interface

#include <codecogs/finance/banking/future_value.h>

using namespace Finance::Banking;

Overview

<div align="center"> <table border="0"> <tr align="center"><td width="100"><strong>Type</strong></td><td><strong>Description</strong></td></tr> <tr><td align="center" valign="top"><em>pp_EndOfPeriod</em></td><td>Each payment is made at the end of the period.</td></tr> <tr><td align="center" valign="top"><em>pp_StartOfPeriod</em></td><td>Each payment is made at the start of the period.</td></tr> </table> </div>

GPL Licence — free for non commercial use. See Licence details.

FUNCTION

future_value

Evaluate the future value of an investment. This is done by solving the following equations to find the value of fv :

If rate = 0,

pv + pmt * nper + fv = 0
(1)

If rate /= 0,

pv(1+rate)^{nper} + pmt[1+rate(when)] \frac{(1+rate)^{nper}}{rate} + fv = 0
(2)

Where pv is the present value, rate is the interest rate, nper is the number of periods over which to calculate and pmt is the payment made each period.

Calculating the future value of an investment according to a scedule of compound interest rates is done using the following equation:

\sum_{i=1}^{nper} (pv * schedule[i])
(3)

Where nper is the number of periods (and in this case entries in the shedule array), pv is the principal value and schedule is an array of compound interest rates.

References

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

Example 1

#include <stdio.h>
#include <codecogs/finance/banking/future_value.h>
 
int main()
{
  double d = Finance::Banking::future_value(0.05, 20, -30000, -30000, Finance::Banking::pp_StartOfPeriod);
  printf("30,000 set aside per year\n");
  printf("5%% interest compounded yearly\n");
  printf("After 20 years, the value of the investment will be: %7.2f\n\n", d);
   
  d = Finance::Banking::future_value(0.00, 7, -50, 0, Finance::Banking::pp_StartOfPeriod);
  printf("50 set aside per year\n");
  printf("no interest\n");
  printf("After 7 years, the value of the investment will be: %.2f\n", d);
  return 0;
}

Output:

30,000 set aside per year
  5% interest compounded yearly
  After 20 years, the value of the investment will be: 1121176.49
 
  50 set aside per year
  no interest
  After 7 years, the value of the investment will be: 350.00

Parameters

rate
is the interest rate
nper
is the number of periods
pmt
is the amount set aside each period
pv
is the present value
when
is the point in each period when the payment is made, either
Blank

pp_StartOfPeriod or pp_EndOfPeriod.

Returns

a double, the future value of the investment.
Author

James Warren (May 2005)