[CDRIVER-3938] Rounding errors in double type in bson_as_relaxed_extended_json() function Created: 26/Mar/21 Updated: 29/Jan/24 Resolved: 27/Apr/21 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libbson |
| Affects Version/s: | 1.17.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Fermín Galán | Assignee: | Roberto Sanchez |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
The bson_as_relaxed_extended_json() is not showing correctly doubles. In particular, if I had:
(I have included only the relevant part of my program for the sake of briefness, but of course, the full code is available if you need it) What I see in my output is:
instead of (i.e. my expectation):
However, in the DB the data is inserted correctly:
Not sure if other functions that also render JSON strings have the same problem. I have checked only bson_as_relaxed_extended_json(). Maybe I'm doing something wrong? Thanks! |
| Comments |
| Comment by Roberto Sanchez [ 27/Apr/21 ] |
|
The behavior described in this ticket is really a variation of the behavior already described in CDRIVER-3812. As that ticket has a some investigation and discussion already associated with it, as well as a reproducer, I am closing this ticket as a duplicate. The work will be completed under CDRIVER-3812. |
| Comment by Kevin Albertson [ 27/Mar/21 ] |
|
Hi fermin.galanmarquez@telefonica.com, thank you for the report! We will look into this soon. At a glance, |