Christian Corti wrote:
!!-1 = !(!-1) = !(0) = 123
!!123 = !(!123) = !(0) = 123
!!0 = !(!0) = !(123) = 0
Whether that's correct behaviour or not was not the question.
If it's supposed to be a C compiler, the unary negation operator can
only return 0 or 1. It returns 0 if its operand is non-zero, and 1 if
its operand is zero.
If we're not talking about a C compiler, what are we talking about?
Eric