Look at the whole rule:
When char and short appear in the expression, both signed and unsigned automatically converted to int or, if necessary, to unsigned int . (If short is the same size as int , unsigned short larger than int , in which case unsigned short converted to unsigned int .) Under K & RC, but not under current C, float automatically converted to double . Since they are conversions for larger types, they are called promotions.
If we look at integer types when they appear, for example. arithmetic expressions, they are still being promoted, so arithmetic is not performed, usually in char or short types, but all in int , unsigned int type or type with a higher conversion rank (in as- if the rule, if the implementation can guarantee, that the result will be the same as if the promotion were actually performed, it can do arithmetic on smaller types if the platform provides instructions).
Similarly, used for float , according to the old pre-standard rules, float was increased to double for all arithmetic, etc.
This is no longer the case, arithmetic on float does not include automatic progress in standardized C.
In expressions with mixed types, as a rule, everything still advances to the largest involved type, so if you compare or add a float to double , the float converted to double before the operation.
Daniel Fischer
source share