in src/main/java/com/ql/util/express/OperatorOfNumber.java [238:264]
public static Number addNormal(Number op1, Number op2) throws Exception {
int type1 = OperatorOfNumber.getSeq(op1.getClass());
int type2 = OperatorOfNumber.getSeq(op2.getClass());
int type = Math.max(type1, type2);
if (type == NumberType.NUMBER_TYPE_BYTE) {
return op1.byteValue() + op2.byteValue();
}
if (type == NumberType.NUMBER_TYPE_SHORT) {
return op1.shortValue() + op2.shortValue();
}
if (type == NumberType.NUMBER_TYPE_INT) {
return op1.intValue() + op2.intValue();
}
if (type == NumberType.NUMBER_TYPE_LONG) {
return op1.longValue() + op2.longValue();
}
if (type == NumberType.NUMBER_TYPE_FLOAT) {
return op1.floatValue() + op2.floatValue();
}
if (type == NumberType.NUMBER_TYPE_DOUBLE) {
return op1.doubleValue() + op2.doubleValue();
}
if (type == NumberType.NUMBER_TYPE_BIG_DECIMAL) {
return new BigDecimal(op1.toString()).add(new BigDecimal(op2.toString()));
}
throw new QLException("不支持的对象执行了\"+\"操作");
}