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

Function IsPrime

mathutil/primes.go:26–84  ·  view source on GitHub ↗

IsPrime returns true if n is prime. Typical run time is about 100 ns. TODO rename to IsPrimeUint32

(n uint32)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 7

NextPrimeFunction · 0.85
FactorIntFunction · 0.85
TestIsPrimeFunction · 0.85
BenchmarkIsPrimeFunction · 0.85
TestFactorIntFunction · 0.85
TestIsPrimeUint16Function · 0.85
TestProbablyPrimeUint32Function · 0.85

Calls 2

IsPrimeUint16Function · 0.85
ModPowUint32Function · 0.85

Tested by 5

TestIsPrimeFunction · 0.68
BenchmarkIsPrimeFunction · 0.68
TestFactorIntFunction · 0.68
TestIsPrimeUint16Function · 0.68
TestProbablyPrimeUint32Function · 0.68