예제 #1
0
 /**
  * Tests whether this {@code BigInteger} is probably prime. If {@code true}
  * is returned, then this is prime with a probability beyond
  * (1-1/2^certainty). If {@code false} is returned, then this is definitely
  * composite. If the argument {@code certainty} <= 0, then this method
  * returns true.
  *
  * @param certainty
  *            tolerated primality uncertainty.
  * @return {@code true}, if {@code this} is probably prime, {@code false}
  *         otherwise.
  */
 public static bool IsProbablePrime(BigInteger value, int certainty, CancellationToken argCancelToken)
 {
     return(Primality.IsProbablePrime(BigMath.Abs(value), certainty, argCancelToken));
 }
예제 #2
0
 /**
  * Tests whether this {@code BigInteger} is probably prime. If {@code true}
  * is returned, then this is prime with a probability beyond
  * (1-1/2^certainty). If {@code false} is returned, then this is definitely
  * composite. If the argument {@code certainty} <= 0, then this method
  * returns true.
  *
  * @param certainty
  *            tolerated primality uncertainty.
  * @return {@code true}, if {@code this} is probably prime, {@code false}
  *         otherwise.
  */
 public static bool IsProbablePrime(BigInteger value, int certainty)
 {
     return(Primality.IsProbablePrime(BigMath.Abs(value), certainty));
 }