# maths

Some encapsulation of mathematical methods.

## install and import.

`go version >= 1.18`

`go get -u github.com/RocsSun/maths`

`import "github.com/RocsSun/maths"`

## functions

### func Sum[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate cumulative sum

### func EachReduceAvgSquareSums[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate the sum of the squares of each number minus the average.

### func ArithmeticAverage[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate the arithmetic mean of the array

### func PopulationVariance[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate the total variance of the array

### func SampleVariance[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate the sample variance of the array

### func OverallStandardDeviation[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate the overall standard deviation of the array.

### func SampleStandardDeviation[args int | int8 | int16 | int32 | int64 | float64 | float32](nums []args) float64

Calculate the sample standard deviation of the array.