让我惊呆的bug。张姿势了。
#include <stdio.h>
int main(int argc, char *argv[])
{
float test1 = 24.73;
float test2 = 20.47;
float test3 = 45.20;
if(test1 + test2 < test3)
printf("True\n");
return 0;
}
竟然print True 。。。。。。。。。。。无语了,浮点数怎么比较。。。。
[解决办法]
浮点数误差,C语言基础。
[解决办法]
说点什么好呢?