Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • 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).

 
Sheriff
Posts: 67399
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: 12855
52
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: 69405
276
  • 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: 69405
276
  • 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: 12855
52
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: 23877
142
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
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic