Roberto Bagnara wrote:
No, Paolo: the result of INT_MIN % -1 is zero, according to the standard.
There is no overflow whatsoever involved. The overflow that you see is
simply an artifact of GCC that produces assembly code that does not
implement
remainder expressions correctly.
Ok, I believe you. However, isn't true that, in general, because the
sign of the result is implementation defined, it's "risky"
(non-portable, whatever), computing the remainder of two negative
quantities? Or, what's the real meaning of 5.6/4?
Paolo.