I'll let you know when this problem is fixed. I'm working on a project for one of my computer science classes right now and it's due tomorrow. 5 hours in and i'm only at 15/38. Yay for bit-level arithmetic in C! (... yea right)
Sample:
CODE /*
* isPos - return 1 if x > 0, return 0 otherwise
* Example: isPos(-1) = 0.
* Legal ops: ! ~ & ^ | + << >>
* Max ops: 8
*/
int isPos(int x) {
return ((x >> 31) + 1) & ~!x;
}