The class encapsulates the 30/360 US year fraction convention. More...

#include <US30360.hpp>

Inheritance diagram for julian::US30360:
julian::YearFraction

Public Member Functions

virtual double operator() (const Date &, const Date &) const
 Calculates year fraction. More...
 
virtual US30360clone () const
 Virtual copy constructor. More...
 
virtual std::string info () const
 Name of a class. More...
 
- Public Member Functions inherited from julian::YearFraction
 YearFraction ()
 Constructor. More...
 
virtual ~YearFraction ()
 Destructor. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &, const unsigned int)
 interface used by Boost serialization library More...
 

Friends

class boost::serialization::access
 

Detailed Description

The class encapsulates the 30/360 US year fraction convention.

According to 30/360 US convention the year fraction is calculated using following formula:

\[YearFraction(dates_1,date_2) = \frac{360(Y_2 - Y_1)+30(M_2-M_1)+(D_2-D_1)}{360}\]

where:

  • $Y_i$ is number of years in $date_i$,
  • $M_i$ is number of months in $date_i$,
  • $D_i$ is number of days in $date_i$.

Additionally the following adjustment is applied:

  • If D_1 is 31, then change D_1 to 30.
  • If D_2 is 31 and D_1 is 30 or 31, then change D_2 to 30

Member Function Documentation

US30360 * julian::US30360::clone ( ) const
virtual

Virtual copy constructor.

Virtual copy constructor of the US30360 class

Implements julian::YearFraction.

std::string julian::US30360::info ( ) const
virtual

Name of a class.

Method returns string that containing information about class.

Implements julian::YearFraction.

double julian::US30360::operator() ( const Date d1,
const Date d2 
) const
virtual

Calculates year fraction.

According to 30/360 US convention the year fraction is calculated using following formula:

\[YearFraction(dates_1,date_2) = \frac{360(Y_2 - Y_1)+30(M_2-M_1)+(D_2-D_1)}{360}\]

where:

  • $Y_i$ is number of years in $date_i$,
  • $M_i$ is number of months in $date_i$,
  • $D_i$ is number of days in $date_i$.

Additionally the following adjustment is applied:

  • If D_1 is 31, then change D_1 to 30.
  • If D_2 is 31 and D_1 is 30 or 31, then change D_2 to 30

Implements julian::YearFraction.

template<class Archive >
void julian::US30360::serialize ( Archive &  ,
const unsigned  int 
)
inlineprivate

interface used by Boost serialization library


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/dates/yearFractions/US30360.hpp
  • C:/Unix/home/OEM/jULIAN/src/dates/yearFractions/US30360.cpp