Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@itchyny
Copy link
Contributor

@itchyny itchyny commented Jul 6, 2023

Due to the differences of DBL_MAX and DBL_MIN definition between compilers, large floating number literals in input JSON are dumped incorrectly as reported by #2367. This PR fixes #2367.

@itchyny itchyny added the bug label Jul 6, 2023
@itchyny itchyny added this to the 1.7 release milestone Jul 6, 2023
// (or "-Infinity"), and to reduce stack allocations as possible, we
// normalize infinities in the callers instead of printing the maximum
// (or minimum) double here.
return NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By returning NULL here will we end up here https://github.com/jqlang/jq/blob/master/src/jv_print.c#L243-L252 and inf gets clamped to DBL_MAX?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.

@itchyny itchyny merged commit 6944d81 into jqlang:master Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent dump results of jq

2 participants