numeric_statistics/lib.rs
1//! # Numeric Statistics Rust crate
2//!
3//! Numeric Statistics provides functions for min, max, average, variance, standard deviation, and more to come.
4//!
5//! ## Example
6//!
7//! ```rust
8//! #[macro_use]
9//! use numeric_statistics::assert_eq_f64;
10//! use numeric_statistics::f64::{
11//! min::*,
12//! max::*,
13//! average::*,
14//! variance::*,
15//! standard_deviation::*
16//! };
17//! let values = &[1.0, 2.0, 4.0];
18//! let min = min(values);
19//! let max = max(values);
20//! let average = average(values);
21//! let variance = variance(values);
22//! let standard_deviation = standard_deviation(values);
23//! assert_eq!(min, 1.0);
24//! assert_eq!(max, 4.0);
25//! assert_eq_f64!(average, 2.3333333333333333 as f64);
26//! assert_eq_f64!(variance, 2.3333333333333333 as f64);
27//! assert_eq_f64!(standard_deviation, 1.5275252316519465 as f64);
28//! ```
29//!
30//! ## All
31//!
32//! You can get all the numeric statistics in one struct like this:
33//!
34//! ```rust
35//! #[macro_use]
36//! use numeric_statistics::assert_eq_f64;
37//! use numeric_statistics::f64::all::All;
38//! let values = &[1.0, 2.0, 4.0];
39//! let all = All::new(values);
40//! assert_eq!(all.min, 1.0);
41//! assert_eq!(all.max, 4.0);
42//! assert_eq_f64!(all.average, 2.3333333333333333 as f64);
43//! assert_eq_f64!(all.variance, 2.3333333333333333 as f64);
44//! assert_eq_f64!(all.standard_deviation, 1.5275252316519465 as f64);
45//! ```
46//!
47//! ## Num Command
48//!
49//! This is a work-in-progress to translate the Num Command software from POSIX into Rust.
50//!
51//! <https://github.com/numcommand/num>
52//!
53//! ## Num Command
54//!
55//! This is a work-in-progress to translate the Num Command software from POSIX into Rust.
56//!
57//! <https://github.com/numcommand/num>
58//!
59
60pub mod all;
61pub mod f32;
62pub mod f64;