Skip to content
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

Couldn't parse the long int correctly in the response json #422

Open
szqmtl opened this issue Sep 21, 2021 · 2 comments
Open

Couldn't parse the long int correctly in the response json #422

szqmtl opened this issue Sep 21, 2021 · 2 comments

Comments

@szqmtl
Copy link

szqmtl commented Sep 21, 2021

when there was a long integer in the response json, it could not parse correctly

Expected outcome

the raw data: [{"id":1110746394641760256,"name":"fc1"}]

Actual outcome

but in "Response" tab, shown ```[
{
"id": 1110746394641760300,
"name": "fc1"
}
]

Versions

App: 16.0.1
Platform: darwin
Electron: 11.4.10
Chrome: 87.0.4280.141
V8: 8.7.220.31-electron.0
Node: 12.18.3

@jarrodek
Copy link
Member

Hi,

Thank you for the issue report.

This limitation is related to JavaScript which uses double-precision floating-point arithmetic, and not ARC's itself.
I did some googling and I ended up creating this gist: https://gist.github.com/jarrodek/24d32cb6a03c40b11fe77651ba223257

I may implement it in ARC if the UI will work with a BigInt instance. I am not entirely sure if it will.
Also, you should take into account while developing an API that all double-precision floating-point arithmetic languages will have the same problem. If you are targeting any of these, especially JavaScript, you should not implement an API using big numbers.

@stale
Copy link

stale bot commented Feb 12, 2022

This issue has been automatically marked as stale because it has not had recent activity and is not currently prioritized. It will be closed in a week if no further activity occurs :)

@stale stale bot added the stale label Feb 12, 2022
@stale stale bot removed the stale label Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants