decmath

package
v5.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyList = fmt.Errorf("empty price list passed in")

Functions

func Average

func Average(ds []sdk.Dec) (sdk.Dec, error)

Average returns the average value of a list of sdk.Dec. Returns error if ds is empty list.

func Max

func Max(ds []sdk.Dec) (sdk.Dec, error)

Max returns the max value of a list of sdk.Dec. Returns error if ds is empty list.

func Median

func Median(ds []sdk.Dec) (sdk.Dec, error)

Median returns the median of a list of sdk.Dec. Returns error if ds is empty list.

func MedianDeviation

func MedianDeviation(median sdk.Dec, ds []sdk.Dec) (sdk.Dec, error)

MedianDeviation returns the standard deviation around the median of a list of sdk.Dec. Returns error if ds is empty list. MedianDeviation = sqrt(∑((d - median)^2 / len(ds)))

func Min

func Min(ds []sdk.Dec) (sdk.Dec, error)

Min returns the min value of a list of sdk.Dec. Returns error if ds is empty list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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