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

Method Mod

bigint.go:650–658  ·  view source on GitHub ↗

Mod calls (big.Int).Mod.

(x, y *BigInt)

Source from the content-addressed store, hash-verified

648
649// Mod calls (big.Int).Mod.
650func (z *BigInt) Mod(x, y *BigInt) *BigInt {
651 var tmp1, tmp2, tmp3 big.Int //gcassert:noescape
652 zi := z.inner(&tmp1)
653 // NOTE: innerOrAlias for the y param because (big.Int).Mod needs to detect
654 // when y is aliased to the receiver.
655 zi.Mod(x.inner(&tmp2), y.innerOrAlias(&tmp3, z, zi))
656 z.updateInner(zi)
657 return z
658}
659
660// ModInverse calls (big.Int).ModInverse.
661func (z *BigInt) ModInverse(g, n *BigInt) *BigInt {

Callers 4

testModSqrtFunction · 0.95
TestBigIntDivisionSignsFunction · 0.80
TestBigIntModInverseFunction · 0.80

Calls 3

innerMethod · 0.95
updateInnerMethod · 0.95
innerOrAliasMethod · 0.80

Tested by 4

testModSqrtFunction · 0.76
TestBigIntDivisionSignsFunction · 0.64
TestBigIntModInverseFunction · 0.64