Java BigInteger Value Check isIn20PercentRange(BigInteger first, BigInteger second)

Here you can find the source of isIn20PercentRange(BigInteger first, BigInteger second)

Description

is In Percent Range

License

Open Source License

Declaration

public static boolean isIn20PercentRange(BigInteger first,
            BigInteger second) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.math.BigInteger;

public class Main {
    public static boolean isIn20PercentRange(BigInteger first,
            BigInteger second) {//from   w w  w.  j  a v a 2s .com
        BigInteger five = BigInteger.valueOf(5);
        BigInteger limit = first.add(first.divide(five));
        return !isMoreThan(second, limit);
    }

    /**
     * @param valueA - not null
     * @param valueB - not null
     * @return true - if the valueA is more than valueB is zero
     */
    public static boolean isMoreThan(BigInteger valueA, BigInteger valueB) {
        return valueA.compareTo(valueB) > 0;
    }
}

Related

  1. isDefined(BigInteger no)
  2. isElementOfZn(BigInteger element, BigInteger n)
  3. isEven(BigInteger x)
  4. isFermatNumber(BigInteger f)
  5. isGoodGaAndGb(BigInteger g_a, BigInteger p)
  6. isInRange(BigInteger in, int range, double eps)
  7. isInt(final BigInteger i)
  8. isIntValue(BigInteger bi)
  9. isLessThan(BigInteger valueA, BigInteger valueB)