Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2766

string to double conversion results in questionable precision

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.6
    • 0.7
    • JMS AMQP 0-x
    • None

    Description

      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).

      Attachments

        Activity

          People

            rajith Rajith Muditha Attapattu
            rajith Rajith Muditha Attapattu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: