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
[expr.unary.op]/8 #4131
Comments
What other word would you suggest to use? |
I would suggest the replacement of the word "negation" by "negative value". |
"negative value" could be a bit weird since the value might not actually be negative. "opposite" or "additive inverse" are options which don't have this problem. |
Just "negative" seems like an improvement: "the result is the negative of its operand". That's pretty standard terminology. (Indeed a negative need not be negative.) |
I don't think it's wrong; see this question on English language stackexchange. The unary operator I don't think "negative" is an improvement. However, I think "additive inverse" would be an improvement, especially because it more directly means the right thing for unsigned types. |
@zygoloid: why is "negative" bad but "additive inverse" is acceptable? Isn't the former simply a name for the latter? |
I took my old copy of Walter Rudin's book "Principles of Mathematical Analysis" (second edition), perhaps one of the most renowned academic texts on the subject, for graduate courses. After a brief rereading of his first chapter "The Real and Complex Number System", I did not identify a single time that the author referred to the |
ISO/IEC 2382:2015 defines:
That's not what we mean here, so we should certainly change this wording (regardless of whether our readership is or is not familiar with this usage of this word). It also defines:
... so we can't use that either, except to describe the operation of
"Negative" also refers to the set of numbers less than zero. Indeed, while ISO/IEC 2382:2015 does not define "negative", it uses it exclusively to refer to numbers less than zero. Also, in my experience it's not common to refer to the additive inverse of an element in an arbitrary ring (such as the ring modeled by an unsigned type) as the negative of that element. I think, for the most part, "additive inverse" uniquely identifies the operation we're looking for here. Hm. But "additive inverse" doesn't work for floating-point types, because +inf doesn't have an additive inverse, but unary minus is typically still well-defined when applied to it. It's also wrong in the presence of signed zeroes, wherein So:
I'm not entirely happy with any of these options. |
I don't see a problem using the term negative for
In arithmetic the name of the operation if x > 0, the negative of x, denoted as -x, is defined as the negative number -x. Thus, if x is an unsigned type with value x, the negative of x, denoted by -x, is defined by |
C uses "negative of" for this purpose. I think that's enough motivation to prefer that word, even though it's not ideal for unsigned types. |
[expr.unary.op]/8:
The negation is obviously wrong.
The text was updated successfully, but these errors were encountered: