Integral and floating point promotions

The integral and floating point promotions are used automatically as part of the usual arithmetic conversions and default argument promotions. The integral and floating point promotions do not change either the sign or the magnitude of the value. For more information about the usual arithmetic conversions, see Usual arithmetic conversions.

C++ only

Integral promotion rules for wchar_t

If a value is of the wchar_t type, the type of the value can be converted to the first of the following types that can represent all the values of the underlying type of wchar_t:
  • int
  • unsigned int
  • long int
  • unsigned long int
  • long long int
  • unsigned long long int
If none of the types in the list can represent all the values of the underlying type of wchar_t, the wchar_t type can be converted to the underlying type of wchar_t.
C++ only

Integral promotion rules for bit field

One of the following rules applies to an integral bit field promotion:
  1. If the int type can represent all the values of an integral bit field, the bit field can be converted to int.
  2. Otherwise, if the unsigned int type can represent all the values, the bit field is converted to unsigned int.
  3. Otherwise, no integral promotion applies to the bit field.

Integral promotion rules for Boolean

The Boolean type can be converted to the int type.

C only. If the Boolean value is 0, the result is an int with a value of 0. If the Boolean value is 1, the result is an int with a value of 1.

C++ only If the Boolean value is false, the result is an int with a value of 0. If the Boolean value is true, the result is an int with a value of 1.

Integral promotion rules for other types

If an integer type other than wchar_t, bit field, and Boolean can be represented by the int type and its rank is lower than the rank of int, the integer type can be converted to the int type. Otherwise, the integer type can be converted to the unsigned int type.

Floating point promotion rules

The float type can be converted to the double type. The float value is not changed after the promotion.