I was reading [this answer](https://stackoverflow.com/a/11227902/886669) and it is mentioned that this code;

```
if (data[c] >= 128)
    sum += data[c];

```

can be replaced with this one;

```
int t = (data[c] - 128) >> 31;
sum += ~t & data[c];

```

I am having hard time grasping this. Can someone explain how bitwise operators achieve what if statement does?