math::mean

Function arithmetic

Source
pub fn arithmetic(slice: &[f64]) -> f64
Expand description

Calculates arithmetic mean (AM) of data set slice.

§Arguments

  • slice - collection of values

§Example

use math::mean;

let slice = [8., 16.];
assert_eq!(mean::arithmetic(&slice), 12.);