- double d = 0.0;
- if (d == 0.0) {
- }
위 같은 코드에서
EPSILON
을 고려해야할까?아니다.
- double d;
- d = 0.0;
- d == 0.0 // guaranteed to evaluate to true, 0.0 can be represented exactly in double
- double d;
- d = 0.1;
- d == 0.1 // not guaranteed to evaluate to true
가 된다. ■