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

Method Abs

bigint.go:357–368  ·  view source on GitHub ↗

big.Int API wrapper methods // Abs calls (big.Int).Abs.

(x *BigInt)

Source from the content-addressed store, hash-verified

355
356// Abs calls (big.Int).Abs.
357func (z *BigInt) Abs(x *BigInt) *BigInt {
358 if x.isInline() {
359 z._inline = x._inline
360 z._inner = nil // !negSentinel
361 return z
362 }
363 var tmp1, tmp2 big.Int //gcassert:noescape
364 zi := z.inner(&tmp1)
365 zi.Abs(x.inner(&tmp2))
366 z.updateInner(zi)
367 return z
368}
369
370// Add calls (big.Int).Add.
371func (z *BigInt) Add(x, y *BigInt) *BigInt {

Callers 8

NumDigitsFunction · 0.95
TestBigIntAbsZFunction · 0.95
QuoMethod · 0.95
integerPowerMethod · 0.95
RunMethod · 0.45
gdaTestFunction · 0.45
TestErrDecimalFunction · 0.45

Calls 3

innerMethod · 0.95
updateInnerMethod · 0.95
isInlineMethod · 0.80

Tested by 5

TestBigIntAbsZFunction · 0.76
RunMethod · 0.36
gdaTestFunction · 0.36
TestErrDecimalFunction · 0.36