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

Function EncodeDecimalAscending

pkg/util/encoding/decimal.go:40–42  ·  view source on GitHub ↗

EncodeDecimalAscending returns the resulting byte slice with the encoded decimal appended to the given buffer. Values are classified as large, medium, or small according to the value of E. If E is 11 or more, the value is large. For E between 0 and 10, the value is medium. For E less than zero, the

(appendTo []byte, d *apd.Decimal)

Source from the content-addressed store, hash-verified

38// consist of the single byte 0x1a followed by a descending varint encoding of
39// E followed by the ones-complement of M.
40func EncodeDecimalAscending(appendTo []byte, d *apd.Decimal) []byte {
41 return encodeDecimal(appendTo, d, false)
42}
43
44// EncodeDecimalDescending is the descending version of EncodeDecimalAscending.
45func EncodeDecimalDescending(appendTo []byte, d *apd.Decimal) []byte {

Callers 2

EncodeForwardIndexMethod · 0.92

Calls 1

encodeDecimalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…