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

Method DivMod

bigint.go:524–534  ·  view source on GitHub ↗

DivMod calls (big.Int).DivMod.

(x, y, m *BigInt)

Source from the content-addressed store, hash-verified

522
523// DivMod calls (big.Int).DivMod.
524func (z *BigInt) DivMod(x, y, m *BigInt) (*BigInt, *BigInt) {
525 var tmp1, tmp2, tmp3, tmp4 big.Int //gcassert:noescape
526 zi := z.inner(&tmp1)
527 mi := m.inner(&tmp2)
528 // NOTE: innerOrAlias for the y param because (big.Int).DivMod needs to
529 // detect when y is aliased to the receiver.
530 zi.DivMod(x.inner(&tmp3), y.innerOrAlias(&tmp4, z, zi), mi)
531 z.updateInner(zi)
532 m.updateInner(mi)
533 return z, m
534}
535
536// Exp calls (big.Int).Exp.
537func (z *BigInt) Exp(x, y, m *BigInt) *BigInt {

Callers 3

TestBigIntDivisionSignsFunction · 0.80
benchmarkBigIntDivFunction · 0.80

Calls 3

innerMethod · 0.95
updateInnerMethod · 0.95
innerOrAliasMethod · 0.80

Tested by 3

TestBigIntDivisionSignsFunction · 0.64
benchmarkBigIntDivFunction · 0.64