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

Function encodeNonsortingDecimalValue

pkg/util/encoding/decimal.go:597–603  ·  view source on GitHub ↗

encodeNonsortingDecimalValue encodes the absolute value of a decimal's exponent and slice of digit bytes into buf, returning the populated buffer after encoding. The function first encodes the absolute value of a decimal's exponent as an unsigned varint. Following this, it copies the decimal's big-e

(exp uint64, digits []big.Word, buf []byte)

Source from the content-addressed store, hash-verified

595// decimal's exponent as an unsigned varint. Following this, it copies the
596// decimal's big-endian digits themselves into the buffer.
597func encodeNonsortingDecimalValue(exp uint64, digits []big.Word, buf []byte) []byte {
598 // Encode the exponent using a Uvarint.
599 buf = EncodeUvarintAscending(buf, exp)
600
601 // Encode the digits into the end of the byte slice.
602 return copyWords(buf, digits)
603}
604
605func encodeNonsortingDecimalValueWithoutExp(digits []big.Word, buf []byte) []byte {
606 // Encode the digits into the end of the byte slice.

Callers 1

EncodeNonsortingDecimalFunction · 0.85

Calls 2

EncodeUvarintAscendingFunction · 0.85
copyWordsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…