Crate machine_prime

source ·

Functions

  • Primality testing optimized for the average case in the interval 0;2^64. Approximately 5 times faster than is_prime_wc in the average case, but slightly slower in the worst case
  • Primality testing for the worst case. Panics at zero, flags 1 as prime, flags powers of 2 as prime.
    This option is intended for proving primality for integers that have already been checked using simpler methods. For example one could generate random integers without small factors and then prove that they are prime faster than with is_prime_ac. Other applications include checking primality within a factorization function. Approximately 13% faster against primes than is_prime_ac