financebanking

coupon Number

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.90
sub units 10.55
add a commercial licence to your cart
0
viewed 1472 times and licensed 9 times
www.codecogs.com/d-ox/finance/banking/couponnumber.php
Other modules that are used by this module. We add these to the cart for you whenever you add this module, unless you already own enough licences for them. Click for details
Controller: CodeCogs    Contact Controller

Interface

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

using namespace Finance::Banking;

int couponNumber (int settlement,              int maturity,              Finance::Banking::YearlyFreq freq,              Finance::Banking::YearBasis basis=yb_USA)
Compute the number of coupons payable between settlement and maturity. Excel: COUPNUM

Function Documentation

 
intcouponNumberintsettlement
intmaturity
Finance::Banking::YearlyFreqfreq
Finance::Banking::YearBasisbasis = yb_USA )
This function returns the number of coupons payable between the settlement date and maturity date, rounded up to the nearest whole coupon.
Example:
#include <iostream>
 
#include <codecogs/units/date/date_str.h>
#include <codecogs/finance/banking/couponnumber.h>
 
int main(void)
{
  int settlementDate=Units::Date::date(2004, 1, 25);
  int maturityDate=Units::Date::date(2006, 11, 15);
  int num=Finance::Banking::couponNumber(settlementDate, maturityDate, Finance::Banking::yf_SemiAnnual);
 
  printf("\nsettlement=%s\n", Units::Date::date_str("l dS of F Y", settlementDate));
  printf("maturity=%s\n", Units::Date::date_str("l dS of F Y", maturityDate));
  
  printf("number of coupons=%i\n", num);
  return 1;
}
Output:
settlement=Sunday 25th of January 2004
maturity=Wednesday 15th of November 2006
number of coupons=6
Parameters:
settlementThe settlement date, expressed as a serial Julian date.
maturityThe maturity date of the settlement, expressed as a serial Julian date.
freqThe frequency with which payments are made. Must be yf_Annual, yf_SemiAnnual or yf_Quarterly.
basisThe year basis to use for the calculation.
Returns:
The number of coupons payable between the settlement date and the maturity date.
Authors:
James Warren (August 2005)
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-08 06:16:57

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional