Fixed progress measurement.

This commit is contained in:
Nicolás A. Ortega 2017-03-16 14:59:53 +01:00
parent 74a82e2038
commit a988711918
No known key found for this signature in database
GPG Key ID: 3D786FB3123FF1DD

View File

@ -51,9 +51,9 @@ int outputPrimes(char *file, List *list, size_t startPos) {
puts("0%");
for(size_t i = startPos; i < list->end; ++i) {
if(!mpz_out_raw(out, list->list[i])) return 3;
if(i == list->end / 4) puts("25%");
else if(i == list->end / 2) puts("50%");
else if(i == list->end * 3 / 4) puts("75%");
if(i - startPos == (list->end - startPos) / 4) puts("25%");
else if(i - startPos == (list->end - startPos) / 2) puts("50%");
else if(i - startPos == (list->end - startPos) * 3 / 4) puts("75%");
}
puts("100%");