jscience
  1. jscience
  2. JSCIENCE-64

XMLObjectWriter.write then XMLObjectReader.read of a non-exact Amount loses error

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: Version 6.0
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      64

      Description

      If you do an XMLObjectWriter.write then XMLObjectReader.read of a non-exact
      Amount the error attribute is lost. The "read" Amount value has a zero error
      value, meaning the minimum and maximum properties are exactly equal.

      I tested this against JScience versions 4.3.1, 4.2.0, 4.1.2, 4.1, and 3.3-beta
      (2007/02/15), and they all exhibited the same result.

      I will attach a program demonstrating this issue. I've included the output of
      the original and xml_read Amount's for the non-exact case below.

      Properties of original:
      toString=(12.3399999999999999 ± 8.9E-16) m
      isExact=false
      exactValue=NOT-EXACT
      estimatedValue=12.34
      unit=m
      minimumValue=12.339999999999998
      maximumValue=12.34
      absoluteError=8.881784197001252E-16
      relativeError=7.197556075365683E-17

      Properties of xml_read:
      toString=(1.0E1 ± 0.0) m
      isExact=false
      exactValue=NOT-EXACT
      estimatedValue=12.34
      unit=m
      minimumValue=12.34
      maximumValue=12.34
      absoluteError=0.0
      relativeError=0.0

        Activity

        Hide
        shanmann added a comment -

        Created an attachment (id=7)
        Example of XML write/read losing error attribute.

        Show
        shanmann added a comment - Created an attachment (id=7) Example of XML write/read losing error attribute.

          People

          • Assignee:
            jscience-issues
            Reporter:
            shanmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: