math

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average(values []float64) float64

Average calculates the average of a slice of float64 values.

func CoefficientOfVariation

func CoefficientOfVariation(values []float64) float64

CoefficientOfVariation calculates the coefficient of variation (CV) which is the ratio of standard deviation to mean. CV is a normalized measure of dispersion that is useful for comparing variability across different scales. Uses sample standard deviation (dividing by n-1). Returns NaN when the mean is zero, as CV is mathematically undefined in this case.

func Median

func Median(min, max int64) int64

Median calculates the median value between min and max.

func Percentile

func Percentile(values []float64, percentile float64) float64

Percentile calculates the given percentile of a slice of float64 values.

func StandardDeviation

func StandardDeviation(values []float64) float64

StandardDeviation calculates the sample standard deviation of a slice of float64 values using Bessel's correction (dividing by n-1).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL