fn print_distribution<W: Write>(w: &mut W, values: &[f64]) -> std::io::Result<()> {
    let mut buf = values.to_vec();
    float_ord::sort(&mut buf);

    for &p in &[10, 25, 50, 75, 90, 95, 99] {
        let i = (f64::from(p) / 100.0 * buf.len() as f64) as usize;
        writeln!(
            w,
            "  {}% in {:.4} secs",
            p,
            buf.get(i).unwrap_or(&std::f64::NAN)
        )?;
    }

    Ok(())
}
/// Print distribution of collection of f64
Print distribution of collection of f64
Print distribution of collection of f64
fn print_distribution<W: Write>(w: &mut W, values: &[f64]) -> std::io::Result<()> {
    let mut buf = values.to_vec();
    float_ord::sort(&mut buf);
    for &p in &[10, 25, 50, 75, 90, 95, 99] {
        let i = (f64::from(p) / 100.0 * buf.len() as f64) as usize;
        writeln!(
            w,
            "  {}% in {:.4} secs",
            p,
            buf.get(i).unwrap_or(&std::f64::NAN)
        )?;
    }
    Ok(())
}
fn print_distribution < W : Write > ( w : & mut W , values : & [ f64 ] ) -> std :: io :: Result < ( ) > { let mut buf = values . to_vec ( ) ; float_ord :: sort ( & mut buf ) ; for & p in & [ 10 , 25 , 50 , 75 , 90 , 95 , 99 ] { let i = ( f64 :: from ( p ) / 100.0 * buf . len ( ) as f64 ) as usize ; writeln ! ( w " " p buf get ( i ) unwrap_or ( std f64 NAN ) ) ? ; } Ok ( ( ) ) }
Print distribution of collection of f64
Print distribution of collection of f64
w
&mut W
values
&[f64]