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

json processing error #2442

Closed
UesugiErii opened this issue Jun 17, 2022 · 2 comments
Closed

json processing error #2442

UesugiErii opened this issue Jun 17, 2022 · 2 comments

Comments

@UesugiErii
Copy link

Describe the bug
json process error

To Reproduce
echo '{"a":[10000000000000007],"b":{"10000000000000007":2}}' | jq

Expected behavior
捕获

Environment (please complete the following information):

  • OS and Version: Ubuntu 20.04.4 LTS
  • jq version1.6

Additional context
When the number is greater than 10000000000000000, the result is possible +1 or -1 or dont change

@superhawk610
Copy link

I ran into the same issue - we use large numbers as IDs. The numbers appear to be off by a random amount:

$ echo '{"userId":288158953888548720}' | jq  # off by 20
{
  "userId": 288158953888548740
}

$ echo '{"userId":933278756423858111}' | jq  # off by 111
{
  "userId": 933278756423858000
}

It seems like whatever data type jq stores numeric values in isn't large enough, perhaps?

@superhawk610
Copy link

Seems that this is a duplicate of #1652.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants