Determining if a BigInteger is Prime in Java
问题 I am trying hands on validation of whether a BigInteger number entered is a Prime Number or not! But, it is running fine for smaller numbers like 13,31 ,but it yields error in the case of 15 ;by declaring it as a Prime. I am unable to figure-out the mistake,probably it is hidden in the squareroot() method approach involving binary-search ! Please view the code and help me point out the mistake!!! Calling code :- boolean p=prime(BigInteger.valueOf(15)); System.out.println("P="+p); Called code