The standard signed integer: two's complement encoding for general-purpose computing
A 32-bit integer stores a whole number using all 32 bits. For signed integers (INT32), the most significant bit is the sign bit (0 = positive, 1 = negative) using two's complement encoding. For the unsigned variant, see UINT32.
32-bit integers are the most common integer type in computing. They are the default int type in C, C++, Java, C#, and Rust on most platforms. They provide over 4 billion distinct values, sufficient for most counting, indexing, and general-purpose integer operations.
Unlike floating-point formats, integers represent exact values with no rounding error. Every integer within the format's range is perfectly representable. The trade-off is that they cannot represent fractions or very large/small numbers.
Signed integers use two's complement encoding, where negative numbers are represented by inverting all bits and adding 1. This elegant system has a key property: addition and subtraction work the same way for both signed and unsigned values at the hardware level.
For example, -1 is encoded as 11111111 11111111 11111111 11111111 (all ones), because 232 - 1 = 4,294,967,295.
| Property | Signed (INT32) | Unsigned (UINT32) |
|---|---|---|
| Total Bits | 32 | 32 |
| Minimum Value | -2,147,483,648 | 0 |
| Maximum Value | 2,147,483,647 | 4,294,967,295 |
| Representable Values | 4,294,967,296 | 4,294,967,296 |
| Value | Bit Pattern | Signed | Unsigned |
|---|---|---|---|
| Zero | 00000000000000000000000000000000 | 0 | 0 |
| One | 00000000000000000000000000000001 | 1 | 1 |
| Max Unsigned | 11111111111111111111111111111111 | -1 | 4294967295 |
| Max Signed | 01111111111111111111111111111111 | 2147483647 | 2147483647 |
| All Ones (-1) | 11111111111111111111111111111111 | -1 | 4294967295 |
| Min Signed (-2147483648) | 10000000000000000000000000000000 | -2147483648 | 2147483648 |
Click any bit to flip it. See both the signed (two's complement) and unsigned interpretation of the same bit pattern.
| Property | INT32 | INT16 | INT8 | INT4 |
|---|---|---|---|---|
| Total Bits | 32 | 16 | 8 | 4 |
| Signed Min | -2,147,483,648 | -32,768 | -128 | -8 |
| Signed Max | 2,147,483,647 | 32,767 | 127 | 7 |
| Unsigned Max | 4,294,967,295 | 65,535 | 255 | 15 |
| Step (ULP) | 1 | 1 | 1 | 1 |
| Values | 4,294,967,296 | 65,536 | 256 | 16 |
.s32 as the signed accumulator type (MMA C/D output) for integer Tensor Core operations. INT8×INT8 and INT4×INT4 matrix multiplies accumulate partial sums into INT32 to prevent overflow.torch.int32 for signed 32-bit tensor storage. The ONNX specification defines INT32 = 6 as a core data type.4× i32 C/D fragments. cuBLAS uses int32_t workspace allocations in fixed-point emulation pipelines.int32_t as the default, stable accumulator type for low-precision integer matrix operations on NVIDIA Tensor Cores.