Skip to content

Instantly share code, notes, and snippets.

@kimwalisch
Last active August 14, 2017 09:01
Show Gist options
  • Select an option

  • Save kimwalisch/afd69bf11daf59795c64 to your computer and use it in GitHub Desktop.

Select an option

Save kimwalisch/afd69bf11daf59795c64 to your computer and use it in GitHub Desktop.
Generate primes using the primesieve C++ library
#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