pub trait FloatIterExt {
// Required methods
fn float_min(&mut self) -> f64;
fn float_max(&mut self) -> f64;
}
Expand description
Find the maximum value of Vec<f64>
.
Example:
use wallswitch::FloatIterExt;
let vector: Vec<f64> = vec![4.2, -3.7, 8.1, 0.9];
let max = vector
.iter()
.cloned()
.float_max();
assert_eq!(max, 8.1);
https://www.reddit.com/r/rust/comments/3fg0xr/how_do_i_find_the_max_value_in_a_vecf64/