我正在做一些按位运算作业,它说我的代码有一个“解析错误”我假设它的语法或其他东西......但我找不到丢失的分号或任何东西。你能找出为什么我可能会遇到问题吗?
int isGreater(int x, int y)
{
int xSign = (x>>31);
int ySign = (y>>31);
int check1 = (xSign & ySign) | (~xSign & ~ySign);
int same = ( x + ((~y) + 1) )>>31;
same = !(same & 0x1);
int check2 = (check1 & same) | (~check1 & !xSign);
int equal = (!(x ^ y))<<31>>31;
return (equal & 0) | (~equal & check2);
}