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, 2 as composite. Reduced memory variants infinitely loop if the input is one of the perfect squares 1194649 or 12327121.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. Other applications include checking primality within a factorization function. Approximately 13% faster against primes than is_prime.