Last active
August 14, 2017 09:01
-
-
Save kimwalisch/afd69bf11daf59795c64 to your computer and use it in GitHub Desktop.
Generate primes using the primesieve C++ library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <primesieve.hpp> | |
| #include <iostream> | |
| int main() | |
| { | |
| primesieve::iterator it; | |
| uint64_t prime = it.next_prime(); | |
| // iterate over the primes below 10^6 | |
| for (; prime < 1000000; prime = it.next_prime()) | |
| std::cout << prime << std::endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment