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

Method QuoRem

bigint.go:769–788  ·  view source on GitHub ↗

QuoRem calls (big.Int).QuoRem.

(x, y, r *BigInt)

Source from the content-addressed store, hash-verified

767
768// QuoRem calls (big.Int).QuoRem.
769func (z *BigInt) QuoRem(x, y, r *BigInt) (*BigInt, *BigInt) {
770 if xVal, xNeg, ok := x.innerAsUint64(); ok {
771 if yVal, yNeg, ok := y.innerAsUint64(); ok {
772 if quoVal, quoNeg, ok := quoInline(xVal, yVal, xNeg, yNeg); ok {
773 if remVal, remNeg, ok := remInline(xVal, yVal, xNeg, yNeg); ok {
774 z.updateInnerFromUint64(quoVal, quoNeg)
775 r.updateInnerFromUint64(remVal, remNeg)
776 return z, r
777 }
778 }
779 }
780 }
781 var tmp1, tmp2, tmp3, tmp4 big.Int //gcassert:noescape
782 zi := z.inner(&tmp1)
783 ri := r.inner(&tmp2)
784 zi.QuoRem(x.inner(&tmp3), y.inner(&tmp4), ri)
785 z.updateInner(zi)
786 r.updateInner(ri)
787 return z, r
788}
789
790// Rand calls (big.Int).Rand.
791func (z *BigInt) Rand(rnd *rand.Rand, n *BigInt) *BigInt {

Callers 11

RoundMethod · 0.95
TestBigIntNoNegativeZeroFunction · 0.95
RemMethod · 0.95
ModfMethod · 0.95
ReduceMethod · 0.95
TestBigIntDivisionSignsFunction · 0.80
checkQuoFunction · 0.80
TestBigIntQuoFunction · 0.80
BenchmarkBigIntQuoRemFunction · 0.80
QuoMethod · 0.80

Calls 6

updateInnerFromUint64Method · 0.95
innerMethod · 0.95
updateInnerMethod · 0.95
quoInlineFunction · 0.85
remInlineFunction · 0.85
innerAsUint64Method · 0.80

Tested by 6

TestBigIntNoNegativeZeroFunction · 0.76
TestBigIntDivisionSignsFunction · 0.64
checkQuoFunction · 0.64
TestBigIntQuoFunction · 0.64
BenchmarkBigIntQuoRemFunction · 0.64