等价的C语言表达式
!(a<=b).等价的C语言表达式不应该是a>b为什么我在书上看到的是(a<=b)||(a>b)
不过,你认为的也是错的,谁说 !(a<=b) 等价于 a>b 的呀?不能想当然。
程序代码:#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main()
{
double a, b;
memset( &a, 0xFF, sizeof(a) );
memset( &b, 0xFF, sizeof(b) );
bool x = !(a<=b);
bool y = a>b;
printf( "%d %d\n", x, y );
return 0;
}输出为 1 0即 !(a<=b) 和 a>b 并不等价。










