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

Function BenchmarkBigIntModInverse

bigint_test.go:2874–2883  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2872}
2873
2874func BenchmarkBigIntModInverse(b *testing.B) {
2875 p := new(BigInt).SetInt64(1) // Mersenne prime 2**1279 -1
2876 p.Lsh(p, 1279)
2877 p.Sub(p, bigOne)
2878 x := new(BigInt).Sub(p, bigOne)
2879 z := new(BigInt)
2880 for i := 0; i < b.N; i++ {
2881 z.ModInverse(x, p)
2882 }
2883}
2884
2885func BenchmarkBigIntSqrt(b *testing.B) {
2886 n, _ := new(BigInt).SetString("1"+strings.Repeat("0", 1001), 10)

Callers

nothing calls this directly

Calls 4

LshMethod · 0.80
ModInverseMethod · 0.80
SetInt64Method · 0.45
SubMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…