string to double conversion results in questionable precision -------------------------------------------------------------
Key: QPID-2766 URL: https://issues.apache.org/jira/browse/QPID-2766 Project: Qpid Issue Type: Bug Components: Java Client Affects Versions: 0.6 Reporter: Rajith Attapattu Assignee: Rajith Attapattu Priority: Minor Fix For: 0.7 The following test: public void testString2Double_1() { try { Message message = senderSession.createMessage(); message.setStringProperty("pi", "3.14159"); assertEquals(3.14159, message.getDoubleProperty("pi"),0); } catch (JMSException e) { fail(e); } } Fails with: junit.framework.AssertionFailedError: expected:<3.14159> but was:<3.141590118408203> This appears to be because the client ends up doing the equivalent of Double.valueOf(Float.valueOf(value)) when doing string to double conversion rather than the more direct Double.valueOf(value). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscr...@qpid.apache.org