Home > Mobile >  Represent negative numbers in other bases
Represent negative numbers in other bases

Time:10-02

How do I represent negative numbers in non-10 bases, eg say in base 20. I know how to do this in binary using two's complement, but what would the equivalent of two's complement be in other bases?

For example, in base 20, the denary number 100 is represented as 50. How would I make this 50 signed? Would I need to convert it to binary, two's complement it, the convert it back to base-20? It seems a little long-winded.

In that case, negative base-20 50 (which is 100 in base-10) would be 7g, and positive would be just 50. But is this the standard way to represent negative numbers in other bases?

CodePudding user response:

The generalisation of two's complement is radix complement.

The radix complement of an

  • Related