Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bbldc_basicisdaactualactual
[Package bbldc]

Provide stateless functions for the ISDA Actual/Actual convention. More...

Namespaces

namespace  bbldc

Detailed Description

Outline
Purpose:
Provide stateless functions for the ISDA Actual/Actual convention.
Classes:
bbldc::BasicIsdaActualActual ISDA Actual/Actual stateless functions
Description:
This component provides a struct, bbldc::BasicIsdaActualActual, that serves as a namespace for defining a suite of date-related functions used to compute the day count and the year fraction between two dates as per the ISDA Actual/Actual day-count convention. In this day-count convention, the day count between two dates is exactly the number of days occurring in the time period and the year fraction between two dates is the number of full calendar years between the dates plus front-stub and back-stub adjustments.
Usage:
This section illustrates intended use of this component.
Example 1: Computing Day Count and Year Fraction:
The following snippets of code illustrate how to use bbldc::BasicIsdaActualActual methods. First, create two bdlt::Date variables, d1 and d2:
  const bdlt::Date d1(2003, 10, 19);
  const bdlt::Date d2(2003, 12, 31);
Then, compute the day count between the two dates:
  const int daysDiff = bbldc::BasicIsdaActualActual::daysDiff(d1, d2);
  assert(73 == daysDiff);
Finally, compute the year fraction between the two dates:
  const double yearsDiff = bbldc::BasicIsdaActualActual::yearsDiff(d1, d2);
  // Need fuzzy comparison since 'yearsDiff' is a 'double'.
  assert(yearsDiff > 0.1999 && yearsDiff < 0.2001);