分类: C/C++
2008-06-17 23:14:10
|
chinaunix网友2008-10-24 12:46:24
我原创的: #define CAMP(a, b) (-!((a) - (b)) + 2 * (((a) - (b)) >> 31) + 1)
chinaunix网友2008-10-10 11:22:01
//a>b -1 a<=b 0 b>a 1 b<=a 0 #define COMPARE(a,b) (((((long)((b)-(a)))&0x80000000)?-1:0)|((((long)((a)-(b)))&0x80000000)?1:0)) // ab -1
chinaunix网友2008-10-10 11:21:50
//a>b -1 a<=b 0 b>a 1 b<=a 0 #define COMPARE(a,b) (((((long)((b)-(a)))&0x80000000)?-1:0)|((((long)((a)-(b)))&0x80000000)?1:0)) // ab -1
chinaunix网友2008-10-10 11:21:40
//a>b -1 a<=b 0 b>a 1 b<=a 0 #define COMPARE(a,b) (((((long)((b)-(a)))&0x80000000)?-1:0)|((((long)((a)-(b)))&0x80000000)?1:0)) // ab -1
chinaunix网友2008-10-10 11:21:36
//a>b -1 a<=b 0 b>a 1 b<=a 0 #define COMPARE(a,b) (((((long)((b)-(a)))&0x80000000)?-1:0)|((((long)((a)-(b)))&0x80000000)?1:0)) // ab -1