Skip to main content

year_fraction

Function year_fraction 

pub fn year_fraction(
    reference: NaiveDate,
    date: NaiveDate,
) -> Result<f64, CurveError>
Expand description

Year fraction from reference to date on ACT/365.

The abscissa every piecewise family parametrises its pillars over, and the default a rate is formed under when no other measure is stated. The two are separate: see YieldCurve::rate_day_count for which of them a caller can move, and which is internal and cannot be.

ยงErrors

CurveError::BeforeReference if date precedes reference. Discounting backwards is a caller error, not an extrapolation choice, so it is reported rather than clamped.