Repository navigation
fix(jq): print numbers and value errors like jq - #2595
Merged
Merged
Conversation
Computed floats use jq's formatting (1024, 1e+17, 1e-05, NaN as null), input literals keep their token until computed, division and % by zero are errors, % truncates operands, fractional array indexes truncate, gamma is log-gamma, and math/index errors use jq's wording. Claude-Session: https://claude.ai/code/session_01VscpEzxtqpCKx5eRMpywNj
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | f1b5909 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 08:28 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
jq numbers and value errors now follow jq:
1024,1e+17,1e-05, NaN asnull, and infinities as the largest double. Number literals in the input keep their form until they are computed on, so1.0stays1.0.% 0are runtime errors.%truncates its operands.gammais log-gamma.nan,infiniteand related filters no longer depend on dividing by zero.try ... catch.These are patched into the vendored jaq-json:
jqmsg.rs,jq_format_f64anddefs.jq.Why
This is the second jq batch from the pseudo-linus Debian oracle bench. Number formatting and error text were the next most common mismatches with real jq.
Before
Float results used jaq's formatting, dividing by zero produced infinity, and error text used jaq's wording. Oracle bench: jq 74.2%.
After
Oracle bench: jq 75.8%.
Risk
Low. The changes are confined to the jq value type, integer paths are unchanged, and the TM-DOS-110 meter patches are untouched. L-JQ-004 records the remaining literal-preservation gap.
Checklist
math_remtest regenerated against jq 1.7cargo clippy -D warnings,cargo fmtjq.mdNumbers), limitations, jaq-json-vendor knowledge and log updatedhttps://claude.ai/code/session_01VscpEzxtqpCKx5eRMpywNj