Mega Code Archive

 
Categories / Java Book / 003 Essential Classes
 

0185 Probable Prime

boolean isProbablePrime(int certainty) Returns true if this BigInteger is probably prime, false if it's definitely composite. BigInteger nextProbablePrime() Returns the first integer greater than this BigInteger that is probably prime. static BigInteger probablePrime(int bitLength, Random rnd) Returns a positive BigInteger that is probably prime, with the specified bitLength.