Function mathol::statistics::get_min [] [src]

pub fn get_min<T>(data: &[T]) -> Result<T, MatholError> where
    T: Num + Convert + Copy + FromPrimitive + PartialOrd

Remarks

Returns the minimum value of a slice or an error message it the slice is empty

Examples

use mathol::statistics::get_min;

let vec = vec![9.8, 10.1, 10.3, 10.2, 10.2, 10.0, 9.9, 10.3];
assert_eq!(9.8, get_min(&vec).unwrap());

let vec = vec![8, 6, 5, 11, 6, 6];
assert_eq!(5, get_min(&vec).unwrap());