What is the difference between integral promotion and balancing. Can we sum up both the rules by saying that any type is converted to atleast int or unsigned int type before performing any operation(except logical operators &&, ||, !) and to a greater type if any of the operand is of type greater than int ?
What is the difference between integral promotion and balancing. Can we sum up both
Share
There are two different things in the standard but none is called balancing:
….
The general idea for operators that are applied to expressions of different type, is that the the operands are converted to the type where there is the less loss in precision. E.g if
aisfloatandbis double, for the suma + bais converted todoublebefore the addition. Similar ifcisunsigned longit is first converted todoubleforc + b.