financebanking

n Periods

Only available under a commercial licence
COST (GBP)
this unit 1.35
sub units 0.00
add a commercial licence to your cart
0
viewed 1678 times
www.codecogs.com/d-ox/finance/banking/nperiods.php
Controller: CodeCogs    Contact Controller

Interface

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

using namespace Finance::Banking;

enumPaymentPoint
Enumation of Payment point
double nPeriods (double rate,      double pmtValue,      double presentValue,      double futureValue,      Finance::Banking::PaymentPoint type=pp_EndOfPeriod)
Return the number of periods for an investment. Excel: NPER

Function Documentation

N Periods Calculator

  

Add calculator to your site or email
 
doublenPeriodsdoublerate
doublepmtValue
doublepresentValue
doublefutureValue
Finance::Banking::PaymentPointtype = pp_EndOfPeriod )
Calculates the number of periods for an investment based on periodic, constant payments and a constant interest rate. The function works using the following equation:

(1)
\displaystyle \begin{array}{l}pv*(1.0+rate)^{nper}+ \\
pmt(1.0 + rate*type)* \left ( \frac{(1.0 + rate)^{nper}-1}{rate} \right ) + fv = 0
\end{array}

Rearranged to give:
(2)
\displaystyle (1.0+rate)^{nper} = \frac{-fv + pmt(1.0 + rate*type)}
                             {pv + pmt(1.0 + rate*type)}
where:
Example:
#include <iostream>
#include <codecogs/finance/banking/nperiods.h>	
	
int main(void)
{
	printf("nPeriods(0.01, -100, -1000, 10000, pp_StartOfPeriod) = %lf\n",
				 Finance::Banking::nPeriods(0.01,
				-100, -1000, 10000, Finance::Banking::pp_StartOfPeriod));
	
	printf("nPeriods(0.01, -100, -1000, 10000, pp_EndOfPeriod) = %lf\n",
				 Finance::Banking::nPeriods(0.01,
				-100, -1000, 10000, Finance::Banking::pp_EndOfPeriod));
	
	printf("nPeriods(0.01, -100, 1000, 0, pp_EndOfPeriod) = %lf\n",
				 Finance::Banking::nPeriods(0.01,
				-100, 1000, 0,	Finance::Banking::pp_EndOfPeriod));
	
	return 1;
}
Output:
nPeriods(0.01, -100, -1000, 10000, pp_StartOfPeriod) = 59.673866
nPeriods(0.01, -100, -1000, 10000, pp_EndOfPeriod) = 60.082123
nPeriods(0.01, -100, 1000, 0, pp_EndOfPeriod) = 10.588644
Parameters:
rateThe interest rate per period of the investment.
pmtValueThe payment made each period. This value must remain constant over the life of the annuity.
presentValueThe present value of the investment, or the lump-sum amount that a series of future payments is worth right now.
futureValueThe future value of the investment.
typeA value indicating whether the payment is made at the beginning or the end of each period. It is set to either: pp_EndOfPeriod or pp_StartOfPeriod.
Returns:
The number of periods of the investment.
Authors:
James Warren (August 2005)
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.



Other Documentation

 
PaymentPoint
This enumerate type describes the payment points, which can either occur at the begining or end of each periond, i.e
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2008-05-14 11:41:23

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional