Numeric limits
| Type | Bits used | Bytes used | Min value | Max value | ||
| char | 8 | 1 | -128 | 127 | $$-(2^{7})$$ | $$2^{7}-1$$ |
| unsigned char | 8 | 1 | 0 | 255 | $$0$$ | $$2^{8}-1$$ |
| short int | 16 | 2 | -32768 | 32767 | $$-(2^{15})$$ | $$2^{15}-1$$ |
| unsigned short int | 16 | 2 | 0 | 65535 | $$0$$ | $$2^{16}-1$$ |
| int | 32 | 4 | -2147483648 | 2147483647 | $$-(2^{31})$$ | $$2^{31}-1$$ |
| unsigned int | 32 | 4 | 0 | 4294967295 | $$0$$ | $$2^{32}-1$$ |
| long long int | 64 | 8 | -9223372036854775808 | 9223372036854775807 | $$-(2^{63})$$ | $$2^{63}-1$$ |
| unsigned long long int | 64 | 8 | 0 | 18446744073709551615 | $$0$$ | $$2^{64}-1$$ |
The formulas are (where (n) is the number of bits):
| min | max | |
| signed | $$-(2^{n-1})$$ | $$(2^{n-1})-1$$ |
| unsigned | $$0$$ | $$2^n -1$$ |
We could use: http://en.cppreference.com/w/cpp/types/integer.