Skip to content
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

Uniform "ones' complement" and "two's complement" #619

Merged
merged 1 commit into from Mar 7, 2016

Conversation

k-satoda
Copy link
Contributor

"one's complement" is inconsistent with the C standard.
"1's complement" and "2's complement" are also inconsistent.

FYI, I found that there was a lengthy discussion on Wikipedia at 2011
about "one's complement". The C++ standard was mentioned as a notable
use of "one's complement". There seems no consensus in the discussion,
but the main article has been settled as "ones' complement" for years
since then.
https://en.wikipedia.org/wiki/Ones'_complement
https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Computer_science/Archive_10#Ones.27_complement_or_one.27s_complement.3F

For me, a quote from "Art of Computer Programming, Volume 2" by
Donald E. Knuth is convincing.
https://books.google.com/books?id=Zu-HAwAAQBAJ&pg=PT343

... A two's complement number is complemented with respect to a single
power of 2, while ones' complement number is complemented with respect
to a long sequence of 1s. ...

While it is still debatable in general, I think inconsistency with the
C standard is enough for the C++ standard to justify this change.

"one's complement" is inconsistent with the C standard.
"1's complement" and "2's complement" are also inconsistent.
@sigfpe
Copy link

sigfpe commented Feb 13, 2016

Is the inconsistency with the C++ standard enough to justify that the C
standards text be modified?

On Saturday, February 13, 2016, Kazutoshi SATODA notifications@github.com
wrote:

"one's complement" is inconsistent with the C standard.
"1's complement" and "2's complement" are also inconsistent.

FYI, I found that there was a lengthy discussion on Wikipedia at 2011
about "one's complement". The C++ standard was mentioned as a notable
use of "one's complement". There seems no consensus in the discussion,
but the main article has been settled as "ones' complement" for years
since then.
https://en.wikipedia.org/wiki/Ones'_complement

https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Computer_science/Archive_10#Ones.27_complement_or_one.27s_complement.3F

For me, a quote from "Art of Computer Programming, Volume 2" by
Donald E. Knuth is convincing.
https://books.google.com/books?id=Zu-HAwAAQBAJ&pg=PT343

... A two's complement number is complemented with respect to a single
power of 2, while ones' complement number is complemented with respect
to a long sequence of 1s. ...

While it is still debatable in general, I think inconsistency with the

C standard is enough for the C++ standard to justify this change.

You can view, comment on, or merge this pull request online at:

#619
Commit Summary

  • Uniform "ones' complement" and "two's complement"

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#619.

@k-satoda
Copy link
Contributor Author

@sigfpe I think it might be, for example, if the intent of the word in
question was to be compatible with the predecessor in C++.

@sigfpe
Copy link

sigfpe commented Feb 13, 2016

Should the modifications be applied to the C standards draft instead?-------- Original message --------From: Kazutoshi SATODA notifications@github.com Date: 2/13/2016 8:06 AM (GMT-08:00) To: cplusplus/draft draft@noreply.github.com Cc: sigfpe sig.fpe@axiomatics.org Subject: Re: [draft] Uniform "ones' complement" and "two's complement" (#619)
@sigfpe I think it might be, for example, if the intent of the word in

question was to be compatible with the predecessor in C++.


Reply to this email directly or view it on GitHub.

@k-satoda
Copy link
Contributor Author

@sigfpe I personally don't think so. I believe my above comments are
enough to explain why. If you think the C standard should be changed
instead, please explain why.

@sigfpe
Copy link

sigfpe commented Feb 14, 2016 via email

@k-satoda
Copy link
Contributor Author

@sigfpe Sorry if I made the confusion. But no, I didn't.

@zygoloid
Copy link
Member

zygoloid commented Mar 7, 2016

It looks like "one's complement" is more common than "ones' complement" by a fairly large factor:

https://books.google.com/ngrams/graph?content=one%27s+complement%2Cones%27+complement%2Cones+complement&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cone%20%27s%20complement%3B%2Cc0%3B.t1%3B%2Cones%20%27%20complement%3B%2Cc0%3B.t1%3B%2Cones%20complement%3B%2Cc0

However, I'm inclined to take TAOCP as authority here, and I buy the argument that this is really the result of taking "ones's complement" and applying the usual English rule of Xs's -> Xs'.

zygoloid added a commit that referenced this pull request Mar 7, 2016
Uniform "ones' complement" and "two's complement", per the C standard and Knuth.
@zygoloid zygoloid merged commit 553cfb0 into cplusplus:master Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants