Skip to main content

require_finite

Function require_finite 

pub(crate) fn require_finite(
    value: f64,
    what: &'static str,
    at: Option<NaiveDate>,
) -> Result<(), CurveError>
Expand description

Rejects a quote that is NaN or infinite, before any bound is checked.

Every quote-accepting curve constructor calls this ahead of its positivity or monotonicity checks, because those are comparisons and a comparison with NaN is false: without this, NaN <= 0.0 failing to hold would admit a NaN quote as “strictly positive” and poison every evaluation downstream.