-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RADON parses JSON integers as floats, rounding them to a different value #2315
Comments
Could we set the Json parser lib to use quadruple precision floats instead ? Or to only convert into double floats when there's a decimal dot and to an integer when there's not ? |
I believe that's what it's supposed to do 🤔 |
Yes, it converts to integer, but it converts the float to integer, therefore losing precision: witnet-rust/rad/src/operators/string.rs Lines 249 to 260 in 0807e05
The |
So operators like StringParseJSONArray can only parse integers correctly up to MAX_SAFE_INTEGER, which is 2^53-1.
The following test shows how 2^53+1 is parsed as 2^53:
Output:
The text was updated successfully, but these errors were encountered: