// Absolute value for integers int a = -4268; // mask = a >> 31 -> (mask ^ a) - mask int abs = ((a >> 31) ^ a) - (a >> 31);