The operands of binary operators do implicit conversions:
- If either operand has type
long double, the other operand is converted to
long double.
- If either operand has type
double, the other operand is converted to
double.
- If either operand has type
float, the other operand is converted to
float.
- The integral promotions are performed on both operands.
Then the following rules are applied:
- If either operand has type
unsigned long int, the other operand is converted to
unsigned long int.
- If one operand has type
long int and the other has type
unsigned int, if a
long int can represent all values of an
unsigned int, the operand of type
unsigned int is converted to
long int; if a
long int cannot represent all the values of an
unsigned int, both operands are converted to
unsigned long int.
- If either operand has type
long int, the other operand is converted to
long int.
- If either operand has type
unsigned int, the other operand is converted to
unsigned int.
- Both operands have type
int.