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

Method Add

bigint.go:371–385  ·  view source on GitHub ↗

Add calls (big.Int).Add.

(x, y *BigInt)

Source from the content-addressed store, hash-verified

369
370// Add calls (big.Int).Add.
371func (z *BigInt) Add(x, y *BigInt) *BigInt {
372 if xVal, xNeg, ok := x.innerAsUint64(); ok {
373 if yVal, yNeg, ok := y.innerAsUint64(); ok {
374 if zVal, zNeg, ok := addInline(xVal, yVal, xNeg, yNeg); ok {
375 z.updateInnerFromUint64(zVal, zNeg)
376 return z
377 }
378 }
379 }
380 var tmp1, tmp2, tmp3 big.Int //gcassert:noescape
381 zi := z.inner(&tmp1)
382 zi.Add(x.inner(&tmp2), y.inner(&tmp3))
383 z.updateInner(zi)
384 return z
385}
386
387// And calls (big.Int).And.
388func (z *BigInt) And(x, y *BigInt) *BigInt {

Callers 14

incrMethod · 0.95
testModSqrtFunction · 0.95
roundAddOneFunction · 0.45
RunMethod · 0.45
gdaTestFunction · 0.45
TestBigIntSumZZFunction · 0.45
checkQuoFunction · 0.45
randBigIntFunction · 0.45
ExampleErrDecimalFunction · 0.45
checkGcdFunction · 0.45
TestAddFunction · 0.45

Calls 5

updateInnerFromUint64Method · 0.95
innerMethod · 0.95
updateInnerMethod · 0.95
addInlineFunction · 0.85
innerAsUint64Method · 0.80

Tested by 12

incrMethod · 0.76
testModSqrtFunction · 0.76
RunMethod · 0.36
gdaTestFunction · 0.36
TestBigIntSumZZFunction · 0.36
checkQuoFunction · 0.36
randBigIntFunction · 0.36
ExampleErrDecimalFunction · 0.36
checkGcdFunction · 0.36
TestAddFunction · 0.36
TestModfFunction · 0.36