* @param y
     * @param a_MathContext
     * @param decimalPlaces
     * @param a_RoundingMode
     * @return
     */
    private static BigDecimal power(
            BigDecimal x,
            int y,
            MathContext a_MathContext,
            int decimalPlaces,
            RoundingMode a_RoundingMode) {
        // x.pow(y) returned a mathematically incorrect result for
        // x = 1.0000000000000000000000000001, y1 = 100
        // Is x a "supernormal" number in this context?
        //BigDecimal result = x.pow(y1);// Don't attempt to support "supernormal" numbers.

        // Deal with special cases
        // x = 0
        if (x.compareTo(BigDecimal.ZERO) == 0) {
            return BigDecimal.ZERO;
        }
        // x = 1
        if (x.compareTo(BigDecimal.ONE) == 0) {
            return BigDecimal.ONE;
        }
        // y = 0
        if (y == 0) {
            return BigDecimal.ONE;
        }
        // y = 1
        if (y == 1) {
            return roundIfNecessary(x, decimalPlaces, a_RoundingMode);
        }
        // y = 2
        if (y == 2) {
            BigDecimal result = multiplyRoundIfNecessary(
                    x,
                    x,
                    a_MathContext,
                    decimalPlaces,
                    a_RoundingMode);
            return result;
        }
        // x < 0
        if (x.compareTo(BigDecimal.ZERO) == -1) {
            BigDecimal result = power(
                    x.negate(),
                    y,
                    //a_MathContext,
                    decimalPlaces,
                    a_RoundingMode);
            if ((double) y / 2.0d > y / 2) {
                return result;
            } else {
                return result.negate();
            }
        }
        // y < 0
        if (y < 0) {
            BigDecimal power = powerNoSpecialCaseCheck(
                    x,
                    -y,
                    a_MathContext,
                    decimalPlaces + 2,
                    a_RoundingMode);
            BigDecimal result = reciprocal(
                    power,
                    decimalPlaces,
                    a_RoundingMode);
            return result;
            //return round(result, decimalPlaces, a_RoundingMode);
        }
        BigDecimal result = powerNoSpecialCaseCheck(
                x,
                y,
                a_MathContext,
                decimalPlaces,
                a_RoundingMode);
        return result;
    }