MCPcopy Create free account
hub / github.com/dolthub/doltgresql / encodeNonsortingDecimalValue

Function encodeNonsortingDecimalValue

postgres/parser/encoding/decimal.go:615–621  ·  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

613// decimal's exponent as an unsigned varint. Following this, it copies the
614// decimal's big-endian digits themselves into the buffer.
615func encodeNonsortingDecimalValue(exp uint64, digits []big.Word, buf []byte) []byte {
616 // Encode the exponent using a Uvarint.
617 buf = EncodeUvarintAscending(buf, exp)
618
619 // Encode the digits into the end of the byte slice.
620 return copyWords(buf, digits)
621}
622
623func encodeNonsortingDecimalValueWithoutExp(digits []big.Word, buf []byte) []byte {
624 // 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