Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

What is "two's complement"?

I'm in a computer systems course and have been struggling, in part, with two's complement . I want to understand it, but everything I've read hasn't brought the picture together for me. I've read the Wikipedia article and various other articles, including my text book.

What is two's complement, how can we use it and how can it affect numbers during operations like casts (from signed to unsigned and vice versa), bit-wise operations and bit-shift operations?

Answer*

Draft saved
Draft discarded
Cancel
3
  • Wow, it's been a long time since I've seen a speedo with both mph and kph. Australia switched over before I'd hit 10yo and I still remember having to remind the old man (slang: father) of the basic conversions when he tried to do 100mph in a 100kph zone :-) Commented Jun 12, 2021 at 2:44
  • In any case, I think they stopped allowing the odo to roll back at some point. Disconnecting it from the car and using a drill to roll it back was a favourite trick of (some rather dodgy) people when trying to sell their cars with a lower mileage (funny how we still use that term, guess kilometerage never caught on). Commented Jun 12, 2021 at 2:46
  • Related: What do we do with answers that are entirely copied and improperly attributed (only a "reference" link or similar is included)? Commented Jan 25, 2023 at 4:21

AltStyle によって変換されたページ (->オリジナル) /