Returns the fraction of a year represented by the number of whole days
between two dates.
Namespace: Imsl.FinanceAssembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntaxpublic static double Yearfrac(
DateTime startDate,
DateTime endDate,
DayCountBasis basis
)
Public Shared Function Yearfrac (
startDate As DateTime,
endDate As DateTime,
basis As DayCountBasis
) As Double
public:
static double Yearfrac(
DateTime startDate,
DateTime endDate,
DayCountBasis^ basis
)
static member Yearfrac :
startDate : DateTime *
endDate : DateTime *
basis : DayCountBasis -> float
Parameters
- startDate
- Type: SystemDateTime
The DateTime start date of the security.
- endDate
- Type: SystemDateTime
The DateTime end date of the security.
- basis
- Type: Imsl.FinanceDayCountBasis
A DayCountBasis object which contains the type of day count
basis to use.
Return Value
Type:
Double
A
double which specifies the annual yield of a security that
pays interest at maturity.
Remarks
It is computed using the following:
where

equals the number of days from
start to
end,

equals annual
basis.
See Also