Skip to main content

year_fraction_fast

Function year_fraction_fast 

fn year_fraction_fast(
    from: NaiveDate,
    from_ordinal: i32,
    ordinal: i32,
    basis: f64,
) -> Result<f64, CurveError>
Expand description

The year fraction from from_ordinal to ordinal under a fast basis — bit-identical to day_count.year_fraction(from, to) for the conventions fast_basis admits, because actual_days is exactly this integer difference widened and divided.

§Errors

CurveError::BeforeReference if ordinal precedes from_ordinal.