-
Couldn't load subscription status.
- Fork 1.7k
Closed
Labels
Milestone
Description
Hi there,
I found that for large floating numbers, when compiling with gcc and clang, jq would emit different outputs.
For example, for echo '{"a": 1E9999999999}' | jq .,
gcc compiled jq would emit:
{
"a": ((double)1.79769313486231570814527423731704357e+308L)
}
while clang compiled jq would emit:
{
"a": 1.7976931348623157e+308
}
I think the cause is probably different interpretation of DBL_MAX / DBL_MIN in gcc and clang. But to ensure the correctness, robustness, and consistency of jq, it's important to keep programs' behaviour consistent across main-stream compilers.