【发布时间】:2013-07-30 00:20:16
【问题描述】:
对于此代码:
double foo = 100.0;
...
// foo may or may not change value here
...
if (foo == 100) { // will this ever be true?
....
}
是否会调用 if 块?如果不是,检查foo == 100.0是否正确的方法是什么?
【问题讨论】:
标签: java floating-point int