Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1098

Fix test failures due to floating point precision

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0-beta1
    • Fix Version/s: 1.4.0-RC1, 1.4.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Alpine Linux 3.7.0

      Description

      Running the test suite on Alpine Linux produced a couple of test failures due to floating point precision. We can easily resolve these by using numbers that can be better represented in floating point.

      $ cat tests/bson/bson-toPHP-003.diff
      031+     float(3.1400000000003)
      031-     float(3.14)
      245+     float(3.1400000000003)
      245-     float(3.14)
       
      $ cat tests/bson/bug0341.diff
      024+     float(3.1400000000003)
      024-     float(3.14)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmikola Jeremy Mikola
              Reporter:
              jmikola Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: