分类: C/C++
2009-07-15 12:21:54
#include <stdio.h>
#define ZHENG(i) ((i >> 31) == 0)
#define FU(i) ((i >> 31) != 0)
#define COMPARE(a,b) ((ZHENG(a) && FU(b)) || (((ZHENG(a) && ZHENG(b)) || (FU(a) && FU(b))) && ((((a) - (b)) >> 31) == 0)))
void main()
{
int a = 0x80000001;
int b = 0x6FFFFFFF;
if(COMPARE(a,b))
{
printf("a >= b\n");
}
else
{
printf("a < b\n");
}
}