[GODRIVER-725] Numbers that look like integers but are too big should be treated as doubles Created: 19/Dec/18  Updated: 28/Oct/23  Resolved: 20/Dec/18

Status: Closed
Project: Go Driver
Component/s: JSON & ExtJSON
Affects Version/s: None
Fix Version/s: 0.2.0

Type: Bug Priority: Major - P3
Reporter: Craig Wilson Assignee: Craig Wilson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The number I came across was this: "8005332285744496613785600"

 

this fails:

strconv.ParseInt("8005332285744496613785600", 10, 64) 

but this succeeds:

strconv.ParseFloat("8005332285744496613785600", 64) 

We should try the first and, if it fails, fallback and try the second.



 Comments   
Comment by Githook User [ 20/Dec/18 ]

Author:

{'username': 'craiggwilson', 'email': 'craiggwilson@gmail.com', 'name': 'Craig Wilson'}

Message: GODRIVER-725: too big integers should be parsed as doubles.
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/ae01efc5d9d776eaa1c608b20f57f167529be696

Comment by Jeffrey Yemin [ 20/Dec/18 ]

https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/437970

Generated at Thu Feb 08 08:34:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.