simple_hex v0.1.0 SimpleHex.Mean

Link to this section Summary

Functions

The mean is the sum of all values over the number of values

The mean2 is the sum of all values over the number of values divided by 2

Link to this section Functions

The mean is the sum of all values over the number of values.

Examples

iex> SimpleHex.Mean.mean([])
nil
iex> SimpleHex.Mean.mean([1,2,3,4,5])
3.0
iex> SimpleHex.Mean.mean([1.5,-2.1,3,4.5,5])
2.38

The mean2 is the sum of all values over the number of values divided by 2

iex> SimpleHex.Mean.mean2([]) nil iex> SimpleHex.Mean.mean2([1,2,3,4,5]) 1.5 iex> SimpleHex.Mean.mean2([1.5,-2.1,3,4.5,5]) 1.19