I am trying to write a swapping function without using a tmp in C, here's what I'm using:

```
void swap(int *a, int* b) {
    *a += *b;
    *b = *a - *b;
    *a -= *b;
}

```

Now one problem (or so I thought) with this is that we may overflow if `*a + * b > INT_MAX`. What's confusing is that it actually works just fine even with edge cases.. can someone explain why??

Here are some of the test cases I used:

```
int main() {
    int t1Swap[] = {INT_MAX, 1};
    int t2Swap[] = {INT_MAX, INT_MIN};
    int t3Swap[] = {INT_MAX, INT_MAX-1000};
    int t4Swap[] = {INT_MIN, INT_MIN+1000};
}

```

Thanks in advance!