Skip to main content

mean

Function mean 

Source
pub fn mean(values: &[f64]) -> f64
Expand description

Arithmetic mean of values. Returns 0.0 for empty input.

ยงExamples

use codetether_agent::telemetry::provider::stats::mean;

assert_eq!(mean(&[2.0, 4.0, 6.0]), 4.0);
assert_eq!(mean(&[]), 0.0);