isPositive - return true if x > 0, otherwise false
isPositive
true
x > 0
false
Example: isPositive(-1)
isPositive(-1)
Legal ops:
if your working with a number system that uses the MSB as the signage bit, you can do:
int IsPositive(int x) { return (((x >> 31) & 1) ^ 1) ^ !x; }