相关疑难解决方法(0)

与float和float文字相比较的奇怪输出

float f = 0.7;
if( f == 0.7 )
    printf("equal");
else
    printf("not equal");
Run Code Online (Sandbox Code Playgroud)

为什么输出not equal

为什么会这样?

c c++ floating-point double-precision

34
推荐指数
3
解决办法
6725
查看次数

标签 统计

c ×1

c++ ×1

double-precision ×1

floating-point ×1