[edit] Ah ha, printed arrays have position zero on the left. I thought it was on the right.
[edit] Ah ha, printed arrays have position zero on the left. I thought it was on the right.
The reason for putting the least significant digit first is that carries accumulate towards the most significant digit in ordinary arithmetic. Thus many of the simplest operations want to work from least significant to most significant digit. A final carry out at the top might add an extra digit to the result. It would be really annoying to work with arrays that had most significant digit first. If you had an extra digit you'd have to shift the entire array one place to accommodate it!
It's rather clever.
Aka little endian. http://en.wikipedia.org/wiki/Endianness
Rather than digits[2] for -123's least significant digit, and digits[1] for, say, 43's least significant digit.