/* Sieve of Eratosthenes. C code by Frank Pilhofer. */ #include #include #include #define TEST(f,x) (*(f+((x)>>4))&(1<<(((x)&15L)>>1))) #define SET(f,x) *(f+((x)>>4))|=1<<(((x)&15L)>>1) void main(int argc, char *argv[]) { unsigned char *feld=NULL, *zzz; unsigned long teste=1, max, mom, hits=1, count, alloc, s=0, e=1; time_t begin; if (argc > 1) max = atol (argv[1]) + 10000; else max = 14010000L; while (feld==NULL) zzz = feld = malloc (alloc=(((max-=10000L)>>4)+1L)); for (count=0; count