-
If either operand is a type long double, the other operand was converted to type long double.
-
If the above condition is not met and either operand are of type double, the other operand are converted to type double.
-
If the above-conditions is not met and either operand was of type float, the other operand was converted to Ty PE float.
If not floating-point precision
-
If the above three conditions is not met (none of the operands is of floating types), then integral conversions is perf Ormed on the operands as follows:
-
If either operand is of type unsigned longand the other operand are converted to type unsigned long.
-
If the above condition is not met and either operand are of type long and the other of type unsigned int, Both operands is converted to type unsigned long.
-
If the above-the-conditions is not met, and either operand is of type long, the other operand was converted to Ty PE long.
-
If the above three conditions was not met, and either operand was of type unsigned int, the other operand is conve rted to type unsigned int.
-
If none of the above conditions is met, both operands is converted to type int.
- Binary operations do not consider enumerations, and if both types are different and one side is floating-point type, both sides are converted to higher-level floating-point types. Otherwise both sides are integral promotion, and if the two types are different and the same is signed or unsigned, the lower-level type is converted to the high-level type. Otherwise, if the unsigned side level is above or equal to signed side, signed over there convert to unsigned yonder type. Otherwise if the signed side of the type can accommodate unsigned that side of the range, unsigned over there to convert to signed side of the type. Otherwise, both sides are converted to the unsigned type that corresponds to signed.
C + + basic data type conversions