Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Why do we use two's complement?

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an interesting video that explains why practically all computers today use two's complement for signed integers (it's about 16 minutes).

 
Marshal
Posts: 67340
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because 3's complement is just too freaking complicated!
 
lowercase baba
Posts: 12792
51
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and "two's insult" is just plain rude..
 
Marshal
Posts: 67426
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About two years ago we had a British Computer Society meeting with a chap who had his own ideas about numbers. He said that three‑valued numbers was the most efficient compromise between speed and memory use, so maybe three's complement would be efficient after all.
 
Campbell Ritchie
Marshal
Posts: 67426
257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compliment not complement, Fred, so surely you mean “two's ensult”.
 
fred rosenberger
lowercase baba
Posts: 12792
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Compliment not complement, Fred, so surely you mean “two's ensult”.


Dammit, Campbell. I'm a programmer, not an English major!!!

;-)
 
author
Posts: 23853
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I just love obscure Star Trek references ... ... Although, admittedly, in this case, it isn't that obscure.

Henry
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!