예제 #1
0
 public BigInteger nextProbablePrime()
 {
     if (sign < 0)
     {
         throw new ArithmeticException("start < 0: " + this);
     }
     return(Primality.nextProbablePrime(this));
 }
예제 #2
0
        public BigInteger(int bitLength, int certainty, Random rnd)
        {
            if (bitLength < 2)
            {
                throw new ArithmeticException("bitLength < 2");
            }
            BigInteger me = Primality.consBigInteger(bitLength, certainty, rnd);

            sign         = me.sign;
            numberLength = me.numberLength;
            digits       = me.digits;
        }
예제 #3
0
 public bool isProbablePrime(int certainty)
 {
     return(Primality.isProbablePrime(abs(), certainty));
 }