Uploaded image for project: 'FHIR Specification Feedback'
  1. FHIR Specification Feedback
  2. FHIR-19356

FHIRPath test: 1.2 / 1.8 = 0.67

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Persuasive
    • Icon: Medium Medium
    • FHIRPath (FHIR)
    • STU3
    • Implementable Technology Specifications
    • fluentpath
    • Hide

      Agreed, correct the test to use the 8 digits of precision:

      1.2 / 1.8 = 0.66666667

      In addition, add tests for:

      1.2 / 1.8 != 0.6666667
      1.2 / 1.8 != 0.67
      1.2 / 1.8 ~ 0.67
      1.2 / 1.8 !~ 0.6

      Show
      Agreed, correct the test to use the 8 digits of precision: 1.2 / 1.8 = 0.66666667 In addition, add tests for: 1.2 / 1.8 != 0.6666667 1.2 / 1.8 != 0.67 1.2 / 1.8 ~ 0.67 1.2 / 1.8 !~ 0.6
    • Anthony Julian/Brian Pech: 4-0-0
    • Correction
    • Non-substantive

    Description

      This test from https://github.com/HL7/fhir/blob/master/tests/resources/tests-fhir-r4.xml says the result should be true. For the ~ operator, the spec says, " values must be equal, comparison is done on values rounded to the precision of the least precise operand." However, this is the = operator, for which the spec says nothing about rounding (at least not that I can see). There is a mention of supporting at least a 10^-8 step-size, but it permits smaller step sizes, so it hard to say definitely at what point the number should be rounded (how many 6's before that 7).


      I think this the test (and others like it) should be changed from = to ~ (which would cause it to pass). Alternatively, if there is some notion of significant digits at play, then that should be made explicit in the spec. (If the latter is the case, however, then other tests, such as 1.2 * 1.8 = 2.16, are in error.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            plynch Paul Lynch
            Paul Lynch
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: