In C, it is denoted by short. A short integer is often half the size of a standard integer, but this relation may not be correct. It is often a 16-bit integer, although it could be larger, for example, 64 bits. A conforming program can assume that it can safely store values between −(216-1) and 216-1, but it may not assume that the range isn't larger. In Java, a short is always a 16-bit integer.
A variable defined as a short integer in one programming language may be different in size to a similarly defined variable in another. In some languages this size is fixed across platforms, while in others it is machine dependent. In some languages this datatype does not exist at all.
| Programming language | Platforms | Data type name | Signedness | Storage in bytes | Minimum value | Maximum value |
|---|---|---|---|---|---|---|
| C and C++ | common implementations | short
| signed | 2 | -32,768 or -215 | 32,767 or 215-1 |
unsigned short
| unsigned | 2 | 0 | 65,535 or 216-1 | ||
| C# | .NET CLR/CTS | short
| signed | 2 | -32,768 or -215 | 32,767 or 215-1 |
| ushort | unsigned | 2 | 0 | 65,535 or 216-1 | ||
| Java | Java platform | short
| signed | 2 | -32,768 or -215 | 32,767 or 215-1 |
In the Windows API, the datatype SHORT is defined as a 16-bit signed integer on all machines.