That is another case, because the right side operands are not ints.

For ints, I saw references that all operands are promoted to ints,
if they can be represented as an int (that is true for chars, shorts etc.).

Don't know for sure about longs, for example; if long differs in size
from int, and there are longs on the right side, will they be promoted (that is: truncated)
to int, if there is an int on the left side, or will they be evaluated as
longs? That's the key question IMHO, and there should be a reference
in the C language description that makes it clear without doubt - but I
did not yet find such a reference - had not much time to look for it.

(IMO, it would be no good language design if such a core question
is left to the compiler builder - I don't believe it is so).

Kind regards

Bernd



Am 22.07.2013 18:27, schrieb retired-mainfra...@q.com:
The right operand in this case is the result of evaluating the expression.  The 
quoted text is not meant to imply that operands are converted before the right 
hand expression is evaluated.  If that were the case, then
    int x = 14.0/2.1;
would evaluate to 7 which is demonstrably not the case.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to