Return the minimum and the maximum of a slice of `f32`.
(series: &[f32])
| 132 | |
| 133 | /// Return the minimum and the maximum of a slice of `f32`. |
| 134 | fn min_max(series: &[f32]) -> (f32, f32) { |
| 135 | let min = series |
| 136 | .iter() |
| 137 | .fold(std::f32::MAX, |accu, &x| if x < accu { x } else { accu }); |
| 138 | let max = series |
| 139 | .iter() |
| 140 | .fold(std::f32::MIN, |accu, &x| if x > accu { x } else { accu }); |
| 141 | (min, max) |
| 142 | } |
| 143 | |
| 144 | /// Get the type of a `Value`, and its length if it's a list. |
| 145 | fn get_value_type_or_list_length(val: &Value) -> (Type, Option<usize>) { |
no outgoing calls
no test coverage detected