J
Jean-Christophe
Can I assume that an expression like ( X comparison_operator Y )
is always evaluated 0 when it's false and 1 when it's true,
independantly of the compiler used ?
I'd like to know if the code #1 can always replace the code #2:
// #1
n += (x > a) - (x < a);
// #2
if (x > a)
++n;
else if (x < a)
--n;
TIA
is always evaluated 0 when it's false and 1 when it's true,
independantly of the compiler used ?
I'd like to know if the code #1 can always replace the code #2:
// #1
n += (x > a) - (x < a);
// #2
if (x > a)
++n;
else if (x < a)
--n;
TIA