MCPcopy Create free account
hub / github.com/prometheus/common / Equal

Method Equal

model/value_float.go:56–61  ·  view source on GitHub ↗

Equal returns true if the value of v and o is equal or if both are NaN. Note that v==o is false if both are NaN. If you want the conventional float behavior, use == to compare two SampleValues.

(o SampleValue)

Source from the content-addressed store, hash-verified

54// that v==o is false if both are NaN. If you want the conventional float
55// behavior, use == to compare two SampleValues.
56func (v SampleValue) Equal(o SampleValue) bool {
57 if v == o {
58 return true
59 }
60 return math.IsNaN(float64(v)) && math.IsNaN(float64(o))
61}
62
63func (v SampleValue) String() string {
64 return strconv.FormatFloat(float64(v), 'f', -1, 64)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected