3 ms·
How do you represent a negative number in binary? How do you represent 0 in Roman numerals? How do you represent a negative number in decimal? How do you repres
by jscipione 3y ago
How do you represent a negative number in binary? How do you represent 0 in Roman numerals? How do you represent a negative number in decimal? How do you represent a decimal number in decimal? Short answer, you can’t, so you have to cheat. — and . are not decimal numerals just as 0 is not a Roman numeral. Balanced ternary allows you to represent negative numbers without cheating, but as long as we use binary computers, we will have to cheat, and 2’s complement along with fixed sized integers is how we cheat.
- tuukkah 3y agoThe article explains how it's not cheating: you are using modulo arithmetic anyway (the dial visualisation in the article), you can pick which of the congruent numbers is the canonical one, so you choose to pick a negative one for those whose highest bit is set. An article from another commenter explains it more extensively and explicitly: http://www.hadjian.com/articles/20221229_twos_complement.html http://www.hadjian.com/articles/20221229_twos_complement.htm...