Files
firestar5683 ab81464bd1 Maps
Add navigation and map matching providers with the vendored map service sources.

Co-authored-by: Daniel Koepping <elkoled@gmail.com>
Co-authored-by: Danny <dannyirwin31@yahoo.com>
Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
Co-authored-by: dirwin31 <83434411+dirwin31@users.noreply.github.com>
2026-10-14 19:56:17 -05:00

26 lines
455 B
Go

package utils
import (
"math"
"time"
)
type Float32Tracker struct {
LastValue float32
Value float32
UpdatedTime time.Time
AllowNullLastValue bool
}
func (t *Float32Tracker) Update(val float32) (updated bool) {
if t.Value != val {
if t.AllowNullLastValue || !(math.IsNaN(float64(t.Value)) || t.Value == 0) {
t.LastValue = t.Value
}
t.UpdatedTime = time.Now()
t.Value = val
return true
}
return false
}