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

Method Rem

bigint.go:800–814  ·  view source on GitHub ↗

Rem calls (big.Int).Rem.

(x, y *BigInt)

Source from the content-addressed store, hash-verified

798
799// Rem calls (big.Int).Rem.
800func (z *BigInt) Rem(x, y *BigInt) *BigInt {
801 if xVal, xNeg, ok := x.innerAsUint64(); ok {
802 if yVal, yNeg, ok := y.innerAsUint64(); ok {
803 if remVal, remNeg, ok := remInline(xVal, yVal, xNeg, yNeg); ok {
804 z.updateInnerFromUint64(remVal, remNeg)
805 return z
806 }
807 }
808 }
809 var tmp1, tmp2, tmp3 big.Int //gcassert:noescape
810 zi := z.inner(&tmp1)
811 zi.Rem(x.inner(&tmp2), y.inner(&tmp3))
812 z.updateInner(zi)
813 return z
814}
815
816// Rsh calls (big.Int).Rsh.
817func (z *BigInt) Rsh(x *BigInt, n uint) *BigInt {

Callers 6

round05UpFunction · 0.95
TestBigIntNoNegativeZeroFunction · 0.95
RunMethod · 0.45
TestBigIntDivisionSignsFunction · 0.45
TestErrDecimalFunction · 0.45

Calls 5

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

Tested by 5

TestBigIntNoNegativeZeroFunction · 0.76
RunMethod · 0.36
TestBigIntDivisionSignsFunction · 0.36
TestErrDecimalFunction · 0.36