Or login with:
| intcouponDaysInPeriod( | int | sett | |
| int | mat | ||
| Finance::Banking::YearlyFreq | freq | ||
| Finance::Banking::YearBasis | basis = yb_USA | ) |
#include <stdio.h> #include <codecogs/units/date/date.h> #include <codecogs/units/date/dateymd.h> #include <codecogs/finance/banking/coupondaysinperiod.h> int main(void) { int settDate=Units::Date::date(1998, 1, 25); int maturityDate=Units::Date::date(1999, 11, 15); int days=Finance::Banking::couponDaysInPeriod(settDate, maturityDate, Finance::Banking::yf_SemiAnnual, Finance::Banking::yb_Act); int y, m, d; Units::Date::dateYMD(settDate, y, m, d); printf("settlement=%i/%i/%i\n", y, m, d); Units::Date::dateYMD(maturityDate, y, m, d); printf("maturity=%i/%i/%i\n", y, m, d); printf("days in period=%i\n", days); return 0; }Output:
settlement=1998/1/25 maturity=1999/11/15 days in period=181
The yearly frequency to be used in financial calculations <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>yf_Annual</em></td> <td>Payments are made annually.</td> </tr> <tr> <td align="center" valign="top"><em>yf_SemiAnnual</em></td> <td>Payments are semi-annual (2 per year).</td> </tr> <tr> <td align="center" valign="top"><em>yf_Quarterly</em></td> <td>Payments are quarterly (4 per year).</td> </tr> </table>
<div class="errorbox">The module YearBasis. does not yet exist on the system. Should this persist please contact the website administrator.</div>
| sett | The settlement date, expressed as a serial Julian date. |
| mat | The maturity date of the settlement, expressed as a serial Julian date. |
| freq | The frequency with which payments are made: |
| basis | The year basis to use for the calculation: |
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.
You must login to leave a messge