Last active
August 16, 2016 20:17
-
-
Save kimwalisch/92019ba15e4dee253f4b06ab178e18db to your computer and use it in GitHub Desktop.
primesieve_iterator C example
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.h> | |
| #include <stdio.h> | |
| int main() | |
| { | |
| primesieve_iterator it; | |
| primesieve_init(&it); | |
| uint64_t prime; | |
| /* iterate over the primes below 10^6 */ | |
| while ((prime = primesieve_next_prime(&it)) < 1000000) | |
| printf("%llu\n", prime); | |
| primesieve_free_iterator(&it); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment