prime_tools
This util provides a few tools for working with prime numbers.
Mostly for personal use with project euler problems. :)
Generates an ordered list of prime numbers from 2 up to x (exclusive).
Uses the sieve of Eratosthenes under the covers.
To be used in conjunction with get_primes_less_than_x. Be sure to pass in
primes
at least up to sqrt(x).
Figures out if x is prime. This is fast! I've benchmarked it at 2.7 seconds to process 1 million random
u32
s.
Figures out if x is prime. This is pretty slow: I've benchmarked it at 26 seconds to process only 200 random
u64
s. :(