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

Method Neg

bigint.go:710–725  ·  view source on GitHub ↗

Neg calls (big.Int).Neg.

(x *BigInt)

Source from the content-addressed store, hash-verified

708
709// Neg calls (big.Int).Neg.
710func (z *BigInt) Neg(x *BigInt) *BigInt {
711 if x.isInline() {
712 z._inline = x._inline
713 if x._inner == negSentinel {
714 z._inner = nil
715 } else {
716 z._inner = negSentinel
717 }
718 return z
719 }
720 var tmp1, tmp2 big.Int //gcassert:noescape
721 zi := z.inner(&tmp1)
722 zi.Neg(x.inner(&tmp2))
723 z.updateInner(zi)
724 return z
725}
726
727// Not calls (big.Int).Not.
728func (z *BigInt) Not(x *BigInt) *BigInt {

Callers 7

TestBigIntCmpAbsFunction · 0.95
doneMethod · 0.45
initFunction · 0.45
RunMethod · 0.45
TestErrDecimalFunction · 0.45

Calls 3

innerMethod · 0.95
updateInnerMethod · 0.95
isInlineMethod · 0.80

Tested by 5

TestBigIntCmpAbsFunction · 0.76
RunMethod · 0.36
TestErrDecimalFunction · 0.36