M
M Welinder
The title more or less says it all: in C99, is the value of
INT_MIN % -1
well defined (when performed as signed integers) under the assumption of
two-complement representation.
Note, that this is not the usual negative-values-and-% question -- the problem
here is that the corresponding signed division, INT_MIN / -1, overflows. Thus
I don't see what use a%b = a-(a/b)*b can be here.
INT_MIN % -1
well defined (when performed as signed integers) under the assumption of
two-complement representation.
Note, that this is not the usual negative-values-and-% question -- the problem
here is that the corresponding signed division, INT_MIN / -1, overflows. Thus
I don't see what use a%b = a-(a/b)*b can be here.