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

Function decodeNonsortingDecimalValue

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

Source from the content-addressed store, hash-verified

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