# Can I express 100 as a three-digit 9's complement number?

Reading the Appendix A (Binary numbers) of Structured Computer organization by Tanenbaum I've found this exercise:

Signed decimal numbers consisting of $n$ digits can be represented in $n + 1$ digits without a sign. Positive numbers have $0$ as the leftmost digit. Negative numbers are formed by subtracting each digit from $9$. Thus the negative of $014725$ is $985274$. Such numbers are called nine’s complement numbers and are analogous to one’s complement binary numbers. Express the following as three-digit nine's complement numbers: $6$. $-2$, $100$, $-14$, [etc].

Ok, it all works fine with $6$ for instance: using the given rule it is $006 \mapsto 993$. That makes sense: as Tanenbaum says this system for negative-value representation is similar to one's complement: it has two different zero representation ($000$ and $999$) and it has negative possible value as much as the positive ones.

What I don't understand is how can $100$ fit in this scenario. To me, with 3 digits I ca only represent value in range $[-900, 099]$; moreover $100$ is not considered a positive number --it shoudl have a $0$ as leftmost digit.

Is there an error in Tanenbaum-exercise?, if not, where I'm wrong?

Nine's complement representation involves a choice of the exact range of positive and negative numbers. It is natural to let the sign depend on the MSD (most significant digit). It is even more natural to declare that numbers starting with $0,1,2,3,4$ are positive, those starting with $5,6,7,8,9$ are negative. The range of three-digit numbers is then $-500$ to $499$ rather than $-900$ to $99$, and $100$ becomes representable. I suspect that this interpretation is what Tanenbaum intended.
• Uhm ...Tanenbaum says that positive numbers have $0$ as the leftmost digit, not other value; sound enough clear about that. Though, you're saying 9's complement represent numbers as ..., $997 \mapsto -3$, $998 \mapsto -2$, $999 \mapsto -1$, $0 \mapsto 000$, $1 \mapsto 001$, ... Then $+100$ is represented as $100$ while $-100$ is $899$, right? Then where are the analogies with 1's complement for binary numbers? Oct 6, 2013 at 11:05