Skip to main content

real_slice_extreme

Function real_slice_extreme 

Source
fn real_slice_extreme(
    s: &[f64],
    na_rm: bool,
    pick: fn(f64, f64) -> f64,
) -> Option<f64>
Expand description

min / max for a double slice, following R’s rmin / rmax.

Missing values are handled as in real_slice_sum: skipped with na_rm, otherwise an NA (R_IsNA) wins over a NaN (“any NA trumps all NaNs” in R’s source) and is returned as is, bits included, as R’s loop does. None when nothing is left to compare (R then computes the Inf / -Inf result and its warning itself).