public ExtDecimal exp(int scale, RoundingMode rm) {
        if (type == Type.NUMBER) {
            ExtDecimal sum = ExtDecimal.ZERO;
            int limit = 10;
            for (int i = 0; i < limit; i++) {
                ExtDecimal augend = this.pow(i).divide(ExtDecimal.valueOf(i).factorial(), scale, RoundingMode.HALF_DOWN);
                sum = sum.add(augend);
            }
            return sum;
        } else if (type == Type.POSITIVEZERO) {
            return ONE;
        } else if (type == Type.NEGATIVEZERO) {
            return ONE;
        } else if (type == Type.INFINITY) {
            return INFINITY;
        } else if (type == Type.NEGATIVEINFINITY) {
            return POSITIVEZERO;
        } else {
            throw new UnsupportedOperationException("exp of ".toString());
        }
    }