MCPcopy
hub / github.com/prometheus/client_golang / AlmostEqualFloat64s

Function AlmostEqualFloat64s

prometheus/internal/almost_equal.go:50–60  ·  view source on GitHub ↗

AlmostEqualFloat64s is the slice form of AlmostEqualFloat64.

(a, b []float64, epsilon float64)

Source from the content-addressed store, hash-verified

48
49// AlmostEqualFloat64s is the slice form of AlmostEqualFloat64.
50func AlmostEqualFloat64s(a, b []float64, epsilon float64) bool {
51 if len(a) != len(b) {
52 return false
53 }
54 for i := range a {
55 if !AlmostEqualFloat64(a[i], b[i], epsilon) {
56 return false
57 }
58 }
59 return true
60}

Callers 1

TestBucketsFunction · 0.92

Calls 1

AlmostEqualFloat64Function · 0.85

Tested by 1

TestBucketsFunction · 0.74