A binary representation is the abstract model of a type’s possible values and operation results on a particular platform. It is distinct from an object representation, which describes how values are stored in memory. The same value may therefore have different binary representations. section 5.1.3 section 5.7
A type’s binary representation determines the results of its operations and remains observable through operands, operators, library calls, and named platform values. For size_t, inspecting SIZE_MAX together with the operands can determine its arithmetic behavior. section 5.1.3
Unsigned integers provide the clearest model:
- Representable values range from 0 through N − 1, where N is determined by the type’s precision. section 5.7.1
- Represent non-negative values with bits whose positions contribute powers of two; the lowest and highest positions are the least- and most-significant bits. section 5.7.1
- Wrap arithmetic modulo N, so the maximum value is 2^p − 1 and arithmetic is determined by precision p. section 5.7.1
A sixteen-bit unsigned value
For an unsigned type with precision 16, the value 240 sets bits b4 through b7 and clears the others. Its least-significant set bit is b4; its most-significant set bit is b7. The first unrepresentable value is 2^16, so the maximum is 2^16 − 1. section 5.7.1
Table 5.4. Bounds for scalar types used in this book (view table figure)
| Name |
[min, max] |
Where |
Typical |
|---|---|---|---|
| size_t | [0, SIZE_MAX] | <stdint.h> | [0, 2w –1], w = 32, 64 |
| double | [±DBL_MIN, ±DBL_MAX] | <float.h> | [±2–w–2,±2w], w = 1024 |
| signed | [INT_MIN, INT_MAX] | <limits.h> | [–2w, 2w –1], w = 31 |
| unsigned | [0, UINT_MAX] | <limits.h> | [0, 2w –1], w = 32 |
| bool | [false, true] | <stdbool.h> | [0, 1] |
| ptrdiff_t | [PTRDIFF_MIN, PTRDIFF_MAX] | <stdint.h> | [–2w, 2w –1], w = 31, 63 |
| char | [CHAR_MIN, CHAR_MAX] | <limits.h> | [0, 2w –1], w = 7, 8 |
| unsigned char | [0, UCHAR_MAX ] | <limits.h> | [0, 255] |
Compare bounds for size_t, signed and unsigned integers, bool, character types, pointers, and floating-point values. section 5.7.1
Binary representation belongs to C’s abstract state machine: values, types, and representations determine state transitions independently of a computer’s physical storage. Object representation matters when manipulating memory or communicating across differing platform models. section 5.1.3 section 12.8





