How do I check if a number is positive or negative in C#?
For a 32-bit signed integer, such as System.Int32, aka int in C#:
System.Int32
int
bool isNegative = (num & (1 << 31)) != 0;