jq
jq copied to clipboard
Numbers longer 17 digits wiped by zeroes
Describe the bug On windows (wsl) and https://jqplay.org/ numbers longer than 17 digits got 0 in rest.
To reproduce
$ echo '{"userId": 11111111112222222222}' | jq '.userId'
11111111112222222000
I can't reproduce that on my Fedora Linux machine, but that is 100% reproducible on windows (wsl2, ubuntu).
Also, please take a look at play https://jqplay.org/s/I-2MjR2xyq:
What also interesting, filtration also happened incorrectly (https://jqplay.org/s/hIYsvWo0co):
Expected behavior The last snippet return the single result 11111111112222222222
Environment (please complete the following information):
- OS and Version: Windows (wsl, Ubuntu)
- jq version 1.6
This seems expected. https://stedolan.github.io/jq/manual/#Math:
jq currently only has IEEE754 double-precision (64-bit) floating point number support.
This is a frequently asked question (#545 #1652 #1959 #2109 #2131 #2182 #2201) and is already fixed in the master version (implemented by #1752 in Oct, 2019).
$ jq --version
jq-1.6-145-ga9f97e9
$ echo '{"userId": 11111111112222222222}' | jq '.userId'
11111111112222222222
Thank you
jq 1.7 released with the fix. closing