[ https://issues.apache.org/jira/browse/JEXL-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-242. -------------------------------- Resolution: Cannot Reproduce Following code does not reproduce: {code} @Test public void test242() throws Exception { Double a = -40.05d; Double b = -8.01d; Double c = a + b; final JexlContext context = new MapContext(); context.set("a", a); context.set("b", b); JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create(); JexlExpression jsp = JEXL_ENGINE.createExpression("a + b"); Double e = (Double) jsp.evaluate(context); Assert.assertTrue(Double.doubleToLongBits(e) + " != " + Double.doubleToLongBits(c), c.doubleValue() == e.doubleValue()); Assert.assertTrue(Double.doubleToLongBits(e) + " != " + Double.doubleToLongBits(c), a + b == e); } {code} > invalid jexl calculation while doing sum for particular value > ------------------------------------------------------------- > > Key: JEXL-242 > URL: https://issues.apache.org/jira/browse/JEXL-242 > Project: Commons JEXL > Issue Type: Bug > Affects Versions: 3.1 > Reporter: vikas garg > Assignee: Henri Biestro > Priority: Blocker > > For a particular value of 0.05 , jexl is returning value unxepectedly > I have face an issue with following calcualtion: > Double a = -40.05; > Double b = -8.01; > final JexlContext context = new MapContext(); > context.set("a",a); > context.set("b",b); > JexlEngine JEXL_ENGINE = new JexlBuilder().strict(true).silent(true).create(); > JexlExpression jsp = JEXL_ENGINE.createExpression("a+b"); > Double c = jsp.evaluate(context); > The value returned by evaluation is -48.059999999999995 instead of -48.06 > There seems some precision issue in calculation -- This message was sent by Atlassian JIRA (v6.4.14#64029)