Consider the two simple functions:
int return0Comp(){
return (~0);
}
int returnNeg1(){
return -1;
}
I know that on a twos-complement system, ~0==-1
, but on the off-chance that a system isn't using that (does that even happen?*), will these two functions be returning different values?