mirror of
https://github.com/luxfi/math.git
synced 2026-07-27 03:38:49 +00:00
- Create math/big for big.Int utilities (HexOrDecimal256, U256, parsing) - Create math/safe for overflow-safe arithmetic (SafeAdd, SafeMul, etc.) - Move averager files to root package level - Add re-exports in root package for backwards compatibility - Update README with new package structure documentation - Remove old math/meter directory (consolidated elsewhere) - Remove redundant math/ subdirectory structure
17 lines
420 B
Go
17 lines
420 B
Go
// Copyright (C) 2019-2024, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package math
|
|
|
|
import "time"
|
|
|
|
// Averager tracks a continuous time exponential moving average of the provided
|
|
// values.
|
|
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
|
|
}
|