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

Function encodeSmallNumber

postgres/parser/encoding/decimal.go:218–224  ·  view source on GitHub ↗

encodeSmallNumber encodes the exponent and mantissa into a buffer; only used when the exponent is negative. See encodeVarExpNumber.

(negative bool, e int, m []byte, encInto []byte)

Source from the content-addressed store, hash-verified

216// encodeSmallNumber encodes the exponent and mantissa into a buffer; only used
217// when the exponent is negative. See encodeVarExpNumber.
218func encodeSmallNumber(negative bool, e int, m []byte, encInto []byte) []byte {
219 if negative {
220 onesComplement(m)
221 return encodeVarExpNumber(decimalNegSmall, true, uint64(-e), m, encInto)
222 }
223 return encodeVarExpNumber(decimalPosSmall, false, uint64(-e), m, encInto)
224}
225
226// encodeLargeNumber encodes the exponent and mantissa into a buffer; only used
227// when the exponent is larger than 10. See encodeVarExpNumber.

Callers 1

encodeEandMFunction · 0.85

Calls 2

encodeVarExpNumberFunction · 0.85
onesComplementFunction · 0.70

Tested by

no test coverage detected