You could do something like:

if(x > 0 && y > 0 && (x + y) < 0)

{

// Error

}

The only way that the error could happen is if both numbers are positive and the sum is negative. You could do bitmasking too, but this is probably more clean.

if(x > 0 && y > 0 && (x + y) < 0)

{

// Error

}

The only way that the error could happen is if both numbers are positive and the sum is negative. You could do bitmasking too, but this is probably more clean.