Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4725

Fetching data decimal data from CLOB looses precision

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.21.1
    • Component/s: BSON
    • None

      Summary

      Fetching data decimal data  from CLOB looses precision

      Environment

      son lib 1.21.1

      linuxamd64.

      gcc 8

       

      How to Reproduce

       

      For  a data '{"a": 0.1234567890123456789012345, "b": "0.1234567890123456789012345" } after calling bson_init_from_json

       

      when trying to access 'a ' we are getting 0.12345678901234568. we need full data. 

      on analysis what we noticed is that the type of the data is BSON_TYPE_DOUBLE so 16 precisions are considered .

       

      is this behaviour expected? is there any way to preserve the full precision. I know decfloat will, do but how can we control the conversion in  bson_init_from_json.

       

       

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            arunmrmv@gmail.com arun mr
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: