-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
NaNs are weird (dup of #750) #814
Comments
This is a result of NaNs getting displayed as So when Piping the output of jq to jq maps all those NaNs to You need to filter out cases where More generally I think it'd be nice if we has an This works:
Comments? |
See also #750. Options: a) add an I'm disinclined to implement (e). (a) seems harmless. I'm not sure about (b). (c) seems fine. Also, I suppose we could go with (a) and (c) and add a builtin to produce a NaN just in case one really wants EDIT: Fix syntax. |
Making division/remainder operators raise an error is tricky: because of constant folding a constant expression like |
You can now (in master) use EDIT: Indeed, you'll have to! |
thanks @nicowilliams for the explanation and the suggestion I tried filtering out the zero division case before filing this issue, but I must have fouled that up. Your example works. |
@nicowilliams - Progress to be sure, but in a way, we're back to Square 1:
We'd probably need to use the strings "Infinity" and "NaN" in a consistent way to make these anomalies go away. |
On Wed, Jun 17, 2015 at 07:46:26PM -0700, pkoppstein wrote:
It's a NaN. It gets printed as Division will raise when dividing by zero, and only then.
jq simply can't do that; see above. But users can now replace NaNs with |
Nor can jq raise an error when outputting a value that contains a NaN: the NaN might be too deeply buried in the value. Since jq has been outputting NaNs as |
I am getting strange results using the
add
function.Reproduce by grabbing my sample data:
The following does not give the result I expect:
Yet this does:
The text was updated successfully, but these errors were encountered: