* @param div Optimisation parameter...
     * @param decimalPlaces The number of decimal places rounded to if rounding
     * is necessary.
     * @param a_RoundingMode The RoundingMode used in the case rounding is
     * necessary.
     * @return true iff x^y > compare
     */
    public static boolean powerTestAbove(
            BigDecimal compare,
            BigDecimal x,
            BigInteger y,
            int div,
            int decimalPlaces,
            RoundingMode a_RoundingMode) {
        if (div < 3) {
            div = 2;
        } else {
            if (div > 256) {
                div = 256;
            }
        }
        BigInteger div_BigInteger = BigInteger.valueOf(div);
        BigDecimal toCompare = BigDecimal.ONE;
        BigDecimal toCompare0;
        int compareScale = compare.scale();
        int powerDecimalPlaces;
        // Deal with special case
        if (y.compareTo(div_BigInteger) == -1) {
            powerDecimalPlaces = Math.min(compareScale + 1, decimalPlaces);
            toCompare0 = power(
                    x,
                    y,
                    div,
                    powerDecimalPlaces,
                    a_RoundingMode);
            if (toCompare0.compareTo(compare) == 1) {
                return true;
            } else {
                return false;
            }
        }
        BigInteger y1 = new BigInteger(y.toString());
        BigInteger[] yDivideAndRemainder;
        int toCompareScale;
        int toCompare0Scale;
        while (y1.compareTo(BigInteger.ONE) == 1) {
            toCompareScale = toCompare.scale();
            if (y1.compareTo(div_BigInteger) == -1) {
                powerDecimalPlaces = Math.min(
                        (div * compareScale) + 1,
                        decimalPlaces);
                toCompare0 = power(
                        x,
                        y1,
                        div,
                        powerDecimalPlaces,
                        a_RoundingMode);
            } else {
                yDivideAndRemainder = y1.divideAndRemainder(div_BigInteger);
                powerDecimalPlaces = Math.min(
                        compareScale + 1,
                        decimalPlaces);
                boolean powerTest0 = powerTestAbove(
                        compare,
                        x,
                        yDivideAndRemainder[0],
                        div,
                        powerDecimalPlaces,
                        a_RoundingMode);
                if (powerTest0) {
                    return true;
                } else {
                    powerDecimalPlaces = Math.min(
                            (div * compareScale) + 1,
                            decimalPlaces);
                    toCompare0 = power(
                            x,
                            yDivideAndRemainder[0],
                            div,
                            powerDecimalPlaces,
                            a_RoundingMode);
                }
                if (toCompare.compareTo(compare) == 1) {
                    return true;
                }
                if (yDivideAndRemainder[1].compareTo(BigInteger.ONE) == 1) {
                    BigDecimal resultRemainder = power(
                            x,
                            yDivideAndRemainder[1],
                            div,
                            decimalPlaces, // @TODO Is this sufficient?
                            a_RoundingMode);
                    if (resultRemainder.compareTo(compare) == 1) {
                        return true;
                    }
                    toCompare0 = multiplyRoundIfNecessary(
                            toCompare0,
                            resultRemainder,
                            decimalPlaces,
                            a_RoundingMode); // @TODO Is this the correct form of multiply?
                    if (toCompare.compareTo(compare) == 1) {
                        return true;
                    }
                }
            }
            toCompare = multiplyRoundIfNecessary(
                    toCompare,
                    toCompare0,
                    decimalPlaces,
                    a_RoundingMode); // @TODO Is this the correct form of multiply?
            if (toCompare.compareTo(compare) == 1) {
                return true;
            }
            y1 = y1.divide(div_BigInteger);
        }
        return false;
    }