Loading tests/rho_pollard.c +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ int f(x) { return x*x+1; } int has_cycle(list_t l, int n) { int has_cycle(list_t l, int n, unsigned long int *d) { srand(time(NULL)); l = list_is_empty(l); int x = rand() % n; Loading @@ -33,7 +33,7 @@ int has_cycle(list_t l, int n) { x = f(x) % n; int xk; l = list_push(l, x); while(gcd(abs(x-f(x)), n) != 1) { while((*d=gcd(abs(x-f(x)), n)) != 1) { xk = list_top(l); l = list_push(l, xk); l = list_tail(l); Loading @@ -41,7 +41,7 @@ int has_cycle(list_t l, int n) { return 0; } // pollard // rho_pollard int main() { // En utilisant l'algorithme rho de Pollard, factorisez les entiers suivants Loading Loading
tests/rho_pollard.c +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ int f(x) { return x*x+1; } int has_cycle(list_t l, int n) { int has_cycle(list_t l, int n, unsigned long int *d) { srand(time(NULL)); l = list_is_empty(l); int x = rand() % n; Loading @@ -33,7 +33,7 @@ int has_cycle(list_t l, int n) { x = f(x) % n; int xk; l = list_push(l, x); while(gcd(abs(x-f(x)), n) != 1) { while((*d=gcd(abs(x-f(x)), n)) != 1) { xk = list_top(l); l = list_push(l, xk); l = list_tail(l); Loading @@ -41,7 +41,7 @@ int has_cycle(list_t l, int n) { return 0; } // pollard // rho_pollard int main() { // En utilisant l'algorithme rho de Pollard, factorisez les entiers suivants Loading