math

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: BSD-3-Clause Imports: 4 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 Add64

func Add64(a, b uint64) (uint64, error)

Add64 ...

func Diff64

func Diff64(a, b uint64) uint64

Diff64 ...

func Max64

func Max64(a, b uint64) uint64

Max64 ...

func Min64

func Min64(a, b uint64) uint64

Min64 ...

func Mul64

func Mul64(a, b uint64) (uint64, error)

Mul64 ...

func Sub64

func Sub64(a, b uint64) (uint64, error)

Sub64 returns: 1) a - b 2) If there is underflow, an error

Types

type Averager

type Averager interface {
	// Observe the value at the given time
	Observe(value float64, currentTime time.Time)

	// Read returns the average of the provided values.
	Read() float64
}

Averager tracks a continuous time exponential moving average of the provided values.

func NewAverager

func NewAverager(
	initialPrediction float64,
	halflife time.Duration,
	currentTime time.Time,
) Averager

func NewSyncAverager

func NewSyncAverager(averager Averager) Averager

Jump to

Keyboard shortcuts

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