MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / MillerRandomTest

Function MillerRandomTest

math/prime/millerrabintest.go:78–81  ·  view source on GitHub ↗

MillerRandomTest This is the intermediate step that repeats within the miller rabin primality test for better probabilitic chances of receiving the correct result with random witnesses.

(num int64)

Source from the content-addressed store, hash-verified

76// miller rabin primality test for better probabilitic chances of
77// receiving the correct result with random witnesses.
78func MillerRandomTest(num int64) (bool, error) {
79 random := rand.Int63n(num-2) + 2
80 return MillerTest(num, random)
81}
82
83// MillerTestMultiple is like MillerTest but runs the test for multiple
84// witnesses.

Callers 1

MillerRabinProbabilisticFunction · 0.85

Calls 1

MillerTestFunction · 0.85

Tested by

no test coverage detected