[][src]Function frank::imean

pub fn imean<T: Clone + AsPrimitive<i128>>(vector: &[T]) -> T where
    i128: AsPrimitive<T>, 

fn imean(vector) takes generic vector primitives and calculates a every bit accurate (if not especially fast) integer mean for long vector primitives 64 bits or smaller. Potentially useful for signal processing where the signal could be obscured by sig. digit loss in f64 values. Rounds half and up away from zero and less than half towards zero (-9/4-> -2, 9/2 -> 4). Not recommended for 128bit primitives unless addition overflow in 128bits can always be avoided.