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

Function encodeNonsortingDecimalValue

pkg/util/encoding/decimal.go:601–607  ·  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

599// decimal's exponent as an unsigned varint. Following this, it copies the
600// decimal's big-endian digits themselves into the buffer.
601func encodeNonsortingDecimalValue(exp uint64, digits []big.Word, buf []byte) []byte {
602 // Encode the exponent using a Uvarint.
603 buf = EncodeUvarintAscending(buf, exp)
604
605 // Encode the digits into the end of the byte slice.
606 return copyWords(buf, digits)
607}
608
609func encodeNonsortingDecimalValueWithoutExp(digits []big.Word, buf []byte) []byte {
610 // 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…