Description
ArrayUtils.contains(double[], double) does not handle Double.NaN correctly. That is, ArrayUtils.contains() returns false, even if the given array contains Double.NaN.
For example, consider the following:
double[] a = new double[]{Double.NEGATIVE_INFINITY, Double.NaN, Double.POSITIVE_INFINITY}; System.out.println(ArrayUtils.contains(a, Double.POSITIVE_INFINITY)); // true System.out.println(ArrayUtils.contains(a, Double.NEGATIVE_INFINITY)); // true System.out.println(ArrayUtils.contains(a, Double.NaN)); // false ?
Attachments
Issue Links
- relates to
-
LANG-1615 ArrayUtils contains() and indexOf() fails to handle Float.NaN
- Resolved
- links to