Originally
posted by
lymz:
How did I end up with negative military units, and negative networth? It shows me as 0 nw on the scores list.
A 64-bit integer can store a number between -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 (That is negative "2 to the power of 63" to "positive 2 to the power of 63" minus 1. The minus 1 on the positive range accounts for the fact that 0 is also an integer.
Because of how 2s Complement (
http://en.wikipedia.org/wiki/Two%27s_complement) works, numbers larger than +9,223,372,036,854,775,807 wrap around to -9,223,372,036,854,775,808. That is, adding 1 to the former gets you the latter.
This is also why there used to be 2b limit because a 32-bit integer's range is -2,147,483,648 to +2,147,483,647.