Click or drag to resize
BondYearfrac Method
Returns the fraction of a year represented by the number of whole days between two dates.

Namespace: Imsl.Finance
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
public static double Yearfrac(
	DateTime startDate,
	DateTime endDate,
	DayCountBasis basis
)

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:

A/D
where A equals the number of days from start to end, D equals annual basis.

See Also