Crate primal_check
source ·Expand description
Check some primality-related properties of numbers.
This crate is designed to be used via primal
.
Functions§
- Returns integers
(y, k)
such thatx = y^k
withk
maximised (other than forx = 0, 1
, in which casey = x
,k = 1
). - Return
Some((p, k))
ifx = p^k
for some primep
andk >= 1
(that is, including whenx
is itself a prime). - Test if
n
is prime, using the deterministic version of the Miller-Rabin test.