decmath

package
v0.4.1-rc4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

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 []math.LegacyDec) (math.LegacyDec, error)

Average returns the average value of a list of math.LegacyDec. Returns error if ds is empty list.

func Max

func Max(ds []math.LegacyDec) (math.LegacyDec, error)

Max returns the max value of a list of math.LegacyDec. Returns error if ds is empty list.

func Median

func Median(ds []math.LegacyDec) (math.LegacyDec, error)

Median returns the median of a list of math.LegacyDec. Returns error if ds is empty list.

func MedianDeviation

func MedianDeviation(median math.LegacyDec, ds []math.LegacyDec) (math.LegacyDec, error)

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

func Min

func Min(ds []math.LegacyDec) (math.LegacyDec, error)

Min returns the min value of a list of math.LegacyDec. Returns error if ds is empty list.

func NewDecFromFloat

func NewDecFromFloat(f float64) (math.LegacyDec, error)

NewDecFromFloat converts a float64 into a math.LegacyDec. Returns error if float64 cannot be converted into a string, or into a subsequent math.LegacyDec.

Types

This section is empty.

Jump to

Keyboard shortcuts

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