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

Function decodeNonsortingDecimalValue

pkg/util/encoding/decimal.go:679–697  ·  view source on GitHub ↗
(dec *apd.Decimal, negExp bool, buf, tmp []byte)

Source from the content-addressed store, hash-verified

677}
678
679func decodeNonsortingDecimalValue(dec *apd.Decimal, negExp bool, buf, tmp []byte) error {
680 // Decode the exponent.
681 buf, e, err := DecodeUvarintAscending(buf)
682 if err != nil {
683 return err
684 }
685 if negExp {
686 e = -e
687 }
688
689 bi := &dec.Coeff
690 bi.SetBytes(buf)
691
692 // Set the decimal's scale.
693 nDigits := int(apd.NumDigits(bi))
694 exp := int(e) - nDigits
695 dec.Exponent = int32(exp)
696 return nil
697}
698
699func decodeNonsortingDecimalValueWithoutExp(dec *apd.Decimal, buf, tmp []byte) {
700 bi := &dec.Coeff

Callers 1

Calls 1

DecodeUvarintAscendingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…