MCPcopy Create free account
hub / github.com/andeya/algorithm / ProbablyPrimeUint32

Function ProbablyPrimeUint32

mathutil/mathutil.go:508–527  ·  view source on GitHub ↗

* ProbablyPrimeUint32 returns true if n is prime or n is a pseudoprime to base a. It implements the Miller-Rabin primality test for one specific value of 'a' and k == 1. Wrt pseudocode shown at http://en.wikipedia.org/wiki/Miller-Rabin_primality_test#Algorithm_and_running_time Input: n > 3, an od

(n, a uint32)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

IsPrimeUint64Function · 0.85
TestProbablyPrimeUint32Function · 0.85

Calls 1

ModPowUint32Function · 0.85

Tested by 2

TestProbablyPrimeUint32Function · 0.68