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

Method Equal

model/value_float.go:55–60  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected