我正在修改C并正在做一些测试程序。在一个程序中,我正在检查一个正在翻译这种情况的条件。这个C程序的输出我不明白
#include <stdio.h>
int main()
{
if(0 <= 3000.000000 <= 2000.00){ //this is the condition
printf("3000 is less than 2000, whoa.. \n");
}
return 0;
}
输出始终是此打印字符串。我不明白为什么。
P.S
我测试的中间值,即3000.000000这里,但它可以有一些变化。
可能重复[什么是“比较常量与布尔表达式总是为真”警告的意思?](http://stackoverflow.com/questions/30807947/what-does-comparing-constant-with-boolean-expression- is-always-true-warning-me) –