Code example for BigDecimal

Methods: add

    public final static class DoubleDelegate extends ELArithmetic { 
        protected Number add(Number num0, Number num1) {
        	// could only be one of these 
        	if (num0 instanceof BigDecimal) {
        		return ((BigDecimal) num0).add(new BigDecimal(num1.doubleValue()));
        	} else if (num1 instanceof BigDecimal) {
        		return ((new BigDecimal(num0.doubleValue()).add((BigDecimal) num1)));
            return new Double(num0.doubleValue() + num1.doubleValue());
        protected Number coerce(Number num) {
            if (num instanceof Double)
                return num;
            if (num instanceof BigInteger)
            	return new BigDecimal((BigInteger) num);
            return new Double(num.doubleValue());
        protected Number coerce(String str) {