Type | Storage size | Value range
--- | --- | ---
sbyte | 1 byte | -2<sup>7</sup> to 2<sup>7</sup>-1
byte | 1 byte | 0 to 2<sup>8</sup>-1
short | 2 bytes | -2<sup>15</sup> to 2<sup>15</sup>-1
ushort | 2 bytes | 0 to 2<sup>16</sup>-1
int | 4 bytes | -2<sup>31</sup> to 2<sup>31</sup>-1
uint | 4 bytes | 0 to 2<sup>32</sup>-1
nint | 4 bytes or 8 bytes | -2<sup>31</sup> to 2<sup>31</sup>-1 or -2<sup>63</sup> to 2<sup>63</sup>-1
nuint | 4 bytes or 8 bytes | 0 to 2<sup>32</sup>-1 or 0 to 2<sup>64</sup>-1
long | 8 bytes | -2<sup>63</sup> to 2<sup>63</sup>-1
ulong | 8 bytes | 0 to 2<sup>64</sup>-1
long long | 8 bytes | -2<sup>63</sup> to 2<sup>63</sup>-1
unsigned long long | 8 bytes | 0 to 2<sup>64</sup>-1
You can use the nint and nuint keywords to define native-sized integers. These are 32-bit integers when running in a 32-bit process, or 64-bit integers when running in a 64-bit process. They can be used to optimise performance in scenarios where integer maths is used extensively.
```
using System;
namespace HelloWorld
{
class Hello {
static void Main(string[] args)
{
sbyte sb = 1; Console.WriteLine(sb);
byte b = 1; Console.WriteLine(b);
short s = -1; Console.WriteLine(s);
ushort us = 1; Console.WriteLine(us);
int i = -1; Console.WriteLine(i);
uint ui = 1; Console.WriteLine(ui);
//nint ni = -1; Console.WriteLine(ni);
//nuint nui = 1; Console.WriteLine(nui);
long l = -1; Console.WriteLine(l);
ulong ul = 1; Console.WriteLine(ul);
}
}
}
```
Outputs:
```
1
1
-1
1
-1
1
-1
1
```