Whenever you find yourself thinking about problems like this choose a simple example to start with. For example consider one bit. The only possible numbers are 0 and 1. So there are 2^1 possible numbers and the largest possible number is 2^1 - 1.
So your program is 32 bit even though it's running on a 64 bit computer. There is an option somewhere in VS to tell it to use 64 bit instead. I can try and find it if you want ...