-
Notifications
You must be signed in to change notification settings - Fork 52
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
Enhancement: Document or warn when the numerator is assumed #49
Comments
This is an odd behavior / feature. We didn't know that calc assumed a numerator of 1. This looks line an undocumented "feature". It does not look like it harms anything that we can think of. Perhaps your issue should be closed with a "well noticed" comment? What do you think? |
I'm not sure, I think it should throw a error as I'd found this error by accident when I made a typo and forgot to add a numerator the a division, which yielded in a weird result. Cross-checking on another calculator it gave me why it was yielding a weird result, the division didn't had a numerator. Someone could have the same mistake by forgetting a numerator, then |
We are not use if this is a bug or a feature. :-) We are also not sure that there might be code out there that assumes /2 would work. Hummm .. have to think about this. More comments and perhaps even a proposed patch as a pull request are welcome. |
We guess this comes down to a "is it a bug or feature?" question, @Gusted. If this is a "feature" of the calc parser, one might also suggest this might be a feature that one might not want to encourage people using. On the the other hand we cannot think of a harm that such a "feature" causes. We might document the "/2" feature for now AND indicate that it should not be used as it might be disallowed in the future. What do you think of that approach? Alternately if "/2" is a bug, then the parser would need to carefully be modified to disallow it. |
Hmm, I think it's a nice feature, but one that shouldn't exist really. I'd like the approach of documenting the |
When doing a division(e.g.
1/2
), the provided numerator is used.However when you don't specify the numerator(e.g.
/2
),calc
assumes the numerator is 1 and process it with that value. I couldn't find documentation if this is a intended change or not as all calculators I've used trowed a error on such expression. Is this intended, or is this a bug?The text was updated successfully, but these errors were encountered: