标签:
const float CHAZHI = 0.0000001; float a = ...; float b = ...; float d = a - b; if( d > CHAZHI) { printf("a > b"); } else if( d < -CHAZHI) { printf("a < b"); } else if(d <= fabs(CHAZHI)) { printf("a = b"); }
参考资料
http://blog.csdn.net/tjlakewalker/article/details/6836735
标签:
原文地址:http://my.oschina.net/xuleo/blog/406557