MCPcopy Create free account
hub / github.com/cockroachdb/apd / NewWithBigInt

Function NewWithBigInt

decimal.go:87–96  ·  view source on GitHub ↗

NewWithBigInt creates a new decimal with the given coefficient and exponent.

(coeff *BigInt, exponent int32)

Source from the content-addressed store, hash-verified

85
86// NewWithBigInt creates a new decimal with the given coefficient and exponent.
87func NewWithBigInt(coeff *BigInt, exponent int32) *Decimal {
88 d := new(Decimal)
89 d.Coeff.Set(coeff)
90 if d.Coeff.Sign() < 0 {
91 d.Negative = true
92 d.Coeff.Abs(&d.Coeff)
93 }
94 d.Exponent = exponent
95 return d
96}
97
98func consumePrefix(s, prefix string) (string, bool) {
99 if strings.HasPrefix(s, prefix) {

Callers 3

TestDigitsLookupTableFunction · 0.85
TestNewWithBigIntFunction · 0.85

Calls 3

SetMethod · 0.45
SignMethod · 0.45
AbsMethod · 0.45

Tested by 3

TestDigitsLookupTableFunction · 0.68
TestNewWithBigIntFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…