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

Method Sub

bigint.go:941–955  ·  view source on GitHub ↗

Sub calls (big.Int).Sub.

(x, y *BigInt)

Source from the content-addressed store, hash-verified

939
940// Sub calls (big.Int).Sub.
941func (z *BigInt) Sub(x, y *BigInt) *BigInt {
942 if xVal, xNeg, ok := x.innerAsUint64(); ok {
943 if yVal, yNeg, ok := y.innerAsUint64(); ok {
944 if zVal, zNeg, ok := addInline(xVal, yVal, xNeg, !yNeg); ok {
945 z.updateInnerFromUint64(zVal, zNeg)
946 return z
947 }
948 }
949 }
950 var tmp1, tmp2, tmp3 big.Int //gcassert:noescape
951 zi := z.inner(&tmp1)
952 zi.Sub(x.inner(&tmp2), y.inner(&tmp3))
953 z.updateInner(zi)
954 return z
955}
956
957// Text calls (big.Int).Text.
958func (z *BigInt) Text(base int) string {

Callers 11

decrMethod · 0.95
TestBigIntAbsZFunction · 0.95
testModSqrtFunction · 0.95
TestBigIntModSqrtFunction · 0.95
doneMethod · 0.45
RunMethod · 0.45
gdaTestFunction · 0.45
TestBigIntSumZZFunction · 0.45
ExampleErrDecimalFunction · 0.45

Calls 5

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

Tested by 10

decrMethod · 0.76
TestBigIntAbsZFunction · 0.76
testModSqrtFunction · 0.76
TestBigIntModSqrtFunction · 0.76
RunMethod · 0.36
gdaTestFunction · 0.36
TestBigIntSumZZFunction · 0.36
ExampleErrDecimalFunction · 0.36