我正在尝试比较一个BigInteger(基数)的值是否为>
(大于)另一个BigInteger(素数)的值,如果a的值不等于1。如果a的值不为1,则它应该脱离循环。我应该如何比较它们?
Random ran = new Random();
BigInteger prime = new BigInteger(16,ran);
BigInteger base,a,one;
one = new BigInteger("1");
for (int i = 0; i < 65535; i++){
while (base>prime){
base = new BigInteger(16,ran);
}
a = base.modPow(prime.subtract(one),prime);
System.out.println("a: "+a);
if (a != one){
break;
}
}