math

package
v0.8.15 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortUUID

func ShortUUID(prefix string) string

func TimeMS

func TimeMS() int64

Types

type ExpFilter

type ExpFilter struct {
	// contains filtered or unexported fields
}

func NewExpFilter

func NewExpFilter(alpha float64, maxVal float64) *ExpFilter

func NewExpFilterWithOptions added in v0.0.15

func NewExpFilterWithOptions(alpha float64, options ExpFilterOptions) (*ExpFilter, error)

func (*ExpFilter) Apply

func (e *ExpFilter) Apply(exp float64, sample float64) float64

func (*ExpFilter) ApplyWithoutSample added in v0.0.15

func (e *ExpFilter) ApplyWithoutSample(exp float64) (float64, error)

func (*ExpFilter) Filtered

func (e *ExpFilter) Filtered() float64

func (*ExpFilter) Reset

func (e *ExpFilter) Reset(alpha float64)

func (*ExpFilter) ResetWithOptions added in v0.0.15

func (e *ExpFilter) ResetWithOptions(options ExpFilterOptions) error

func (*ExpFilter) UpdateBase

func (e *ExpFilter) UpdateBase(alpha float64)

func (*ExpFilter) Value added in v0.0.15

func (e *ExpFilter) Value() (float64, bool)

type ExpFilterOptions added in v0.0.15

type ExpFilterOptions struct {
	MaxVal  *float64
	MinVal  *float64
	Initial *float64
}

type MovingAverage

type MovingAverage struct {
	// contains filtered or unexported fields
}

func NewMovingAverage

func NewMovingAverage(windowSize int) *MovingAverage

func (*MovingAverage) AddSample

func (m *MovingAverage) AddSample(sample float64)

func (*MovingAverage) GetAvg

func (m *MovingAverage) GetAvg() float64

func (*MovingAverage) Reset

func (m *MovingAverage) Reset()

func (*MovingAverage) Size

func (m *MovingAverage) Size() int

Jump to

Keyboard shortcuts

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