MCPcopy Index your code
hub / github.com/pingcap/tidb / EncodeFloat

Function EncodeFloat

pkg/util/codec/float.go:44–47  ·  view source on GitHub ↗

EncodeFloat encodes a float v into a byte slice which can be sorted lexicographically later. EncodeFloat guarantees that the encoded value is in ascending order for comparison.

(b []byte, v float64)

Source from the content-addressed store, hash-verified

42// EncodeFloat encodes a float v into a byte slice which can be sorted lexicographically later.
43// EncodeFloat guarantees that the encoded value is in ascending order for comparison.
44func EncodeFloat(b []byte, v float64) []byte {
45 u := encodeFloatToCmpUint64(v)
46 return EncodeUint(b, u)
47}
48
49// DecodeFloat decodes a float from a byte slice generated with EncodeFloat before.
50func DecodeFloat(b []byte) ([]byte, float64, error) {

Callers 8

HashCodeMethod · 0.92
encodeDatumMethod · 0.92
datumExprFunction · 0.92
encodeValueDatumFunction · 0.92
encodeFunction · 0.85
HashGroupKeyFunction · 0.85
HashCodeFunction · 0.85
TestFloatCodecFunction · 0.85

Calls 2

encodeFloatToCmpUint64Function · 0.85
EncodeUintFunction · 0.85

Tested by 2

datumExprFunction · 0.74
TestFloatCodecFunction · 0.68