-
Notifications
You must be signed in to change notification settings - Fork 50
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
docs: add note that cross-kind comparisons are undefined #822
Conversation
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.
The language looks okay to me. Left comments for a small grammar correction and the need to add a missing note. Once addressed, LGTM.
Co-authored-by: Athan <kgryte@gmail.com>
Done |
For my understanding, by “comparison of arrays without a corresponding promotable data type”, do you mean that there does not exist a type where both array are promotable to, or do you mean the array has a type that can no longer be promoted “further”? I’m asking because the reference issue involves an example of int64 vs uint64, for which both interpretations apply, so it doesn’t seem entirely clear to me. |
"Promotion" in the context of the standard only applies to two or more data types. So it's referring to the former interpretation. |
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.
LGTM. Thanks, @asmeurer!
I believe this is already implied, as, practically speaking, in order to perform comparison, promotion is necessary (e.g., as automatically happens when comparing a float and a double in C). If we later find that we need to make this more explicit, we can address in a follow-up PR. |
Does the language here look OK? Should we add anything along the lines of "comparisons with promotable types should promote first" (so that the result is numerically correct)?
Fixes #819.