-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add reminder op for floats #229
base: main
Are you sure you want to change the base?
Conversation
Seems CI failure is same as what main branch is failing on |
In accordance with what I wrote in #232 (comment), I think that the behaviour in this PR is not desirable, because it silently loses information about the decimal points. I'm sorry. I hope you understand. |
No worries :) and the reason why jaq does not do non-integer reminder is because jq lacks it? i wonder if jaq's README or documentation could benefit from some notes and gotchas about how to do integer reminder etc, ex using floor etc? |
Hmmm ... we could actually implement non-integer remainders quite easily, because we can already do
I thought that the "Numbers" section of the README did already contain this information. If you have a specific text in mind, I'm all for a little PR. :) |
Ah ok! yeap i can have a look at that
Oh great 👍 not sure how i didn't see that |
Switch float, but i'm not sure i really follow how reminder and floats work :) have to read more about it
|
give(json!(null), "0 % 4000000001", json!(0)); | ||
give(json!(null), "2.1 % -2 | . * 1000 | round", json!(100)); | ||
give(json!(null), "2.1 % -1 | . * 1000 | round", json!(100)); | ||
give(json!(null), "2.1 % 0 | tojson", json!("null")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure i understand why this is needed, because the value is NaN?
This is same as jq modulo (hoh) error message: