> It won't work for decimal 10s complement numbers:
I don't get why you say this -- you go on to demonstrate the opposite?
This is just the other-side-of-the-decimal-point inverse of the well known 0.9999999... = 1 equality.
One of my favorite proofs for 0.9999... being equal to 1 goes like so: imagine subtracting it from 1. You'll get a number which has a 0 at every decimal place: 0.0000000.... Obviously, the number with a 0 in every decimal place is 0 itself.
Similarly, if you have your integer represented decimally as a bunch of coefficients (0 <= c < 10) of powers of 10, and all of the coefficients are 9, it's fairly straightforward to see that adding 1 will get you a new number for which all of the coefficients are 0. Since adding 1 to the original number gave us 0, we can treat the original number as -1.
> It won't work for decimal 10s complement numbers:
I don't get why you say this -- you go on to demonstrate the opposite?
This is just the other-side-of-the-decimal-point inverse of the well known 0.9999999... = 1 equality.
One of my favorite proofs for 0.9999... being equal to 1 goes like so: imagine subtracting it from 1. You'll get a number which has a 0 at every decimal place: 0.0000000.... Obviously, the number with a 0 in every decimal place is 0 itself.
Similarly, if you have your integer represented decimally as a bunch of coefficients (0 <= c < 10) of powers of 10, and all of the coefficients are 9, it's fairly straightforward to see that adding 1 will get you a new number for which all of the coefficients are 0. Since adding 1 to the original number gave us 0, we can treat the original number as -1.