why is my primality test failing so often when randomizing a BigInteger?

I wasn’t able to get true for both p and q, most of the results is both false or rarely p is true but q is false, why wouldn’t this test ever be true for both p and q? BigInteger bitSize100 = new …

is there anyway to convert from Double to BigInteger?

Is there anyway to convert from double value to BigInteger? double doubleValue = 64654679846513164.2; BigInteger bigInteger = (BigInteger) doubleValue; I try to cast it but it didn’t work.