The list of methods to do BigInteger Value Check are organized into topic(s).
boolean
isFermatNumber(BigInteger f) Method to check if a given number is a Fermat number.
if (f.signum() <= 0)
return false;
byte bytes[] = f.toByteArray();
int bLength = bytes.length - 1;
if (bLength == 0) {
switch (bytes[0]) {
case 3:
case 5:
...
boolean
isInRange(BigInteger in, int range, double eps) Tests whether a given BigInteger is in the following range: [-2^range, 2^(eps * range)-1] (inclusive).
if (((in.signum() > 0) && (in.bitLength() > (int) (eps * range))
&& (in.compareTo(BigInteger.valueOf(1).shiftLeft(range)) > 0))
|| ((in.signum() < 0) && (in.bitLength() > range)
&& (in.compareTo(BigInteger.valueOf(-1).shiftLeft(range)) < 0)))
return false;
return true;