CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

FinanceBanking

n Periods

Only available under a commercial licence
COST (GBP)
this unit 1.76
sub units 0.00
add a commercial licence to your cart
0
viewed 1700 times

Enumation of Payment point

Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     add cart

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

 
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:

\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:
(1.0+rate)^{nper} = \frac{-fv + pmt(1.0 + rate*type)}                              {pv + pmt(1.0 + rate*type)}
where:
Example 1:
#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

constant over the life of the annuity.

amount that a series of future payments is worth right now.

beginning or the end of each period. It is set to either: pp_EndOfPeriod or pp_StartOfPeriod.

Parameters:
rateThe interest rate per period of the investment.
pmtValueThe payment made each period. This value must remain
presentValueThe present value of the investment, or the lump-sum
futureValueThe future value of the investment.
typeA value indicating whether the payment is made at the
Returns:
The number of periods of the investment.
Authors:
James Warren (August 2005)
Source Code:

To view or download source code you need to buy a Commercial licence.

buy now     add cart

Not a member, then 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:

To view or download source code you need to buy a Commercial licence.

buy now     add cart

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


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-11 22:44:59

Valid CSS!   Valid XHTML 1.0 Transitional