fork(2) download
  1. import java.math.BigInteger;
  2.  
  3. class TestPrime {
  4. public static void main(final String[] args) {
  5. final BigInteger b = new BigInteger("4082653");
  6. int countTrue = 0;
  7. int countFalse = 0;
  8. final int max = 100_000;
  9. for (int i = 0; i < max; i++) {
  10. if (b.isProbablePrime(10))
  11. ++countTrue;
  12. else
  13. ++countFalse;
  14. }
  15. System.out.println("runs: " + max);
  16. System.out.println("countTrue: " + countTrue);
  17. System.out.println("countFalse: " + countFalse);
  18. }
  19. }
Success #stdin #stdout 1.16s 380672KB
stdin
Standard input is empty
stdout
runs: 100000
countTrue: 34
countFalse: 99966