Integer promotion
Integer promotion is the implicit conversion of certain narrow integer operands to int or another suitable integer type before specified operations.
Modern C, Third Edition
Integer promotion is the implicit conversion of a narrow integer type to an integer type before certain C expressions are evaluated.
- How it is used
- Explains how narrow integers participate in arithmetic, comparisons, and certain function-call conversions.
- How deep it goes
- Defines the initial promotion step and connects it to common arithmetic conversions, but does not enumerate every conversion rule.
- Examples
- Uses char, _Bool, and short arithmetic, plus -1 + 1U and cosf(1) passed to printf.
- What you can do after
- Evaluate arithmetic expressions by identifying narrow operands and the subsequent signed, unsigned, or floating conversion steps.
Read how Modern C, Third Edition explains integer promotion →
Modern C
Integer promotion is the C conversion of a narrow integer type to int or another integer type before certain operations such as arithmetic.
- How it is used
- Explains the conversion applied before arithmetic and comparison involving narrow integer types.
- How deep it goes
- Defines the promotion rule and its typical signed-int result, but defers detailed platform-dependent widths and ranges.
- Examples
- Uses char and bool as prominent narrow types and classifies base types in a tabular overview.
- What you can do after
- Evaluate arithmetic and comparison expressions involving narrow integer types with the promotion rule in mind.
Related concepts
- narrow typeproduced by · A narrow type is a C integer or character type whose values undergo integer promotion before arithmetic evaluation.
- integerproduces · An integer is a whole-number value with no fractional part, including negative numbers, zero, and positive numbers.
- data conversionkind of · Data conversion is the transformation of a value or data from one type, format, or representation to another, explicitly or implicitly.
- promotioncontrasts with · Promotion is Julia's mechanism for converting values of different types to a common type suitable for a joint operation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

