public static void main(String[] arg){
// 计算a+b的时候。第一种方式计算出来的值是错误的。
Map<String,Object> map = new HashMap<>();
JexlEngine jexlEngine = new JexlEngine();
Expression expression = jexlEngine.createExpression("a+b");
map.put("a", "0.05");
map.put("b", "0.01");
JexlContext content = new MapContext(map);
System.out.println(expression.evaluate(content));
//使用BIgDecimal可以解决计算错误的问题。
map.put("a", new BigDecimal("0.05"));
map.put("b", new BigDecimal("0.01"));
JexlContext content1 = new MapContext(map);
System.out.println(expression.evaluate(content1));
}