isPositive - return true if x > 0, otherwise false
isPositive
true
x > 0
false
Example: isPositive(-1)
isPositive(-1)
Legal ops:
int x,len; x = 0x0fffffff; len = (sizeof(x) * 8) - 2; if ((x>>len)) printf("Negative\n"); else printf("Positive\n");
X will be either int or char(Integral type).