Programming languages (e.g. c, c++, and java) usually have several types for integer arithmetic:
signed
and unsigned
types
Maybe just for fun, here you have a simple example showing how according to what type you choose you have one result or an other.
Naturally the actual reason why you would choose one type or an other, in my opinion, is related to other factors. For instance the great shift operator.
#include
#include
using namespace std;
int main()
{
int i;
//unsigned long long x;
//int x;
short x;
x = 2;
for (i=2; i<15; ++i)
{
x=pow(x,2);
cout << x << endl;
}
return 0;
}