Skip to main content

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*

3
  • In the part where you say "The two's complement of an N-bit number x is defined as 2^N - x" what is the valid range of x? Commented Aug 19, 2021 at 7:09
  • @Jack From -2^(N-1) to 2^(N-1) - 1. E.g. a 8-bit signed number in two's complement can range from -128 to +127 (inclusive). Commented Aug 19, 2021 at 10:32
  • 1
    The C Standard requires that one of four methods is used: Signed magnitude, one’s complement, two’s complement, and two’s complement without the largest negative number. Commented Aug 20, 2021 at 6:26