Function math::mean::harmonic [] [src]

pub fn harmonic(slice: &[f64]) -> f64

Calculate harmonic mean (HM) of data set slice.

Arguments

  • slice - collection of values

Example

use math::mean;

let slice = [1., 7.];
assert_eq!(mean::harmonic(&slice), 1.75);