Skip to main content

year_fraction_at_ordinal

Function year_fraction_at_ordinal 

pub(crate) fn year_fraction_at_ordinal(
    reference: NaiveDate,
    reference_ordinal: i32,
    ordinal: i32,
) -> Result<f64, CurveError>
Expand description

Year fraction from a reference ordinal to ordinal on ACT/365 — the integer form of year_fraction, bit-identical to it because date.num_days_from_ce() − reference.num_days_from_ce() equals (date − reference).num_days() exactly.

§Errors

CurveError::BeforeReference if ordinal precedes reference_ordinal.