isPositive - return 1
if x > 0
, return 0
otherwise
Example: isPositive(-1) = 0.
Legal ops: !
~
&
^
|
+
<<
>>(arithmetic shift)
Max ops: 8
Note: No conditional statements are allowed. size of int is a word(4 bytes). It is a signed representation using two's compliment.
int isPositive(int x) {
return ???;
}