MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / DecodeFloatDescending

Function DecodeFloatDescending

pkg/util/encoding/float.go:89–98  ·  view source on GitHub ↗

DecodeFloatDescending decodes floats encoded with EncodeFloatDescending.

(buf []byte)

Source from the content-addressed store, hash-verified

87
88// DecodeFloatDescending decodes floats encoded with EncodeFloatDescending.
89func DecodeFloatDescending(buf []byte) ([]byte, float64, error) {
90 b, r, err := DecodeFloatAscending(buf)
91 if r != 0 && !math.IsNaN(r) {
92 // All values except for 0 and NaN were negated in EncodeFloatDescending, so
93 // we have to negate them back. Negative zero uses composite indexes to
94 // decode itself correctly.
95 r = -r
96 }
97 return b, r, err
98}

Callers 2

DecodeBox2DDescendingFunction · 0.85
prettyPrintFirstValueFunction · 0.85

Calls 1

DecodeFloatAscendingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…