Use size_t, which is better for arrays of very large sizes.
This commit is contained in:
@ -5,7 +5,6 @@
|
||||
#include <gmp.h>
|
||||
|
||||
#include "list.h"
|
||||
#include "types.h"
|
||||
|
||||
static bool run;
|
||||
void leave();
|
||||
@ -43,7 +42,7 @@ int main(void) {
|
||||
// Calculate half of `num'
|
||||
mpz_fdiv_q_ui(halfNum, num, 2);
|
||||
// Loop through found primes
|
||||
for(ulli i = 0; i < primes.end; ++i) {
|
||||
for(size_t i = 0; i < primes.end; ++i) {
|
||||
if(mpz_cmp(primes.list[i], halfNum) > 0) break;
|
||||
// If `num' is divisible by a prime then go to the next number
|
||||
if(mpz_divisible_p(num, primes.list[i]) != 0)
|
||||
|
Reference in New Issue
Block a user