[GODRIVER-426] Change "too precise" float32 behavior Created: 24/May/18 Updated: 28/Oct/23 Resolved: 24/May/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 0.0.5 |
| Fix Version/s: | 0.0.6 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I understand this is not a bug as much as a feature, but I think it's the wrong behavior: Right now if trying to deserialize a float to a float32, the decoder will return 0 if the float is too precise for 32 bits, without giving an error. I think the ideal solution would be to return an error, but that would require major changes. If we have to fail silently, the imprecise number seems better than 0. |
| Comments |
| Comment by Kristofer Brandow (Inactive) [ 24/May/18 ] |
|
Code Review: https://github.com/mongodb/mongo-go-driver/pull/58. |