|
|
@ -254,7 +254,9 @@ int isAsciiDigit(int x) { |
|
|
|
* Rating: 3 |
|
|
|
*/ |
|
|
|
int conditional(int x, int y, int z) { |
|
|
|
return 2; |
|
|
|
x = !!(x); |
|
|
|
x = ~x+1; |
|
|
|
return (x&y)|(~x&z); |
|
|
|
} |
|
|
|
/* |
|
|
|
* isLessOrEqual - if x <= y then return 1, else return 0 |
|
|
@ -264,7 +266,10 @@ int conditional(int x, int y, int z) { |
|
|
|
* Rating: 3 |
|
|
|
*/ |
|
|
|
int isLessOrEqual(int x, int y) { |
|
|
|
return 2; |
|
|
|
int tmp = ~y+1; |
|
|
|
tmp = tmp+x-1; |
|
|
|
tmp = tmp >> 31;//如果比y大,则为0,比y小等于,为1 |
|
|
|
return !!tmp; |
|
|
|
} |
|
|
|
//4 |
|
|
|
/* |
|
|
|