maitrejediyass
Messages postés5Date d'inscriptionmardi 14 décembre 2010StatutMembreDernière intervention22 avril 2012
-
22 avril 2012 à 10:46
Utilisateur anonyme -
5 mai 2012 à 00:40
Bonjour, j'ai une boucle infini au niveau du while , quelqu'un pourrait m'aider à debbugger mon programme
import java.math.*;
import java.util.*;
public class MillerRabin
{
public static void millerRabin(long n, int t)
{
int j;
long b;
long r;
long a;
long y;
b=calculDeB(n);
long resultat=(long)Math.pow(2,b);
r=(n-1)/resultat;
for (int i=0;i<t;i++){
a=random(n);
y=modpow(a,r,n);
if (y!=1 && y!=(n-1))
{
j=1;
/* ici commence la boucle infini */
while(j 0) {
if ((exp&1)>0) result = (result * x) % mod;
exp >>= 1;
x = (x * x) % mod;
}
return result;
}
}
}