Function basic_stochastics::matches_custom_sigma_environment [] [src]

pub fn matches_custom_sigma_environment(
    average: f64,
    sigma: f64,
    sigma_room: f64,
    to_check: f64
) -> bool

Determines, whether the given value matches the given sigma environment using the given µ and σ values. You can either provide a specific sigma environment or use one from the given constants. Please see https://en.wikipedia.org/wiki/Normal_distribution and sigma rooms for further information.

Examples

let sigma = 15.0;
let average = 100.0;

assert_eq!(basic_stochastics::matches_custom_sigma_environment(average, sigma, basic_stochastics::ONE_SIGMA, 110.0), true);
assert_eq!(basic_stochastics::matches_custom_sigma_environment(average, sigma, basic_stochastics::ONE_SIGMA, 120.0), false);