[ 
https://issues.apache.org/jira/browse/LANG-1541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17107468#comment-17107468
 ] 

Gary D. Gregory commented on LANG-1541:
---------------------------------------

[~anthonymaidment]

Feel free to provide a PR on GitHub.

> ArrayUtils.contains() fails to handle Double.NaN
> ------------------------------------------------
>
>                 Key: LANG-1541
>                 URL: https://issues.apache.org/jira/browse/LANG-1541
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.7, 3.10
>            Reporter: Anthony Maidment
>            Priority: Minor
>
> 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: 
> {code:java}
> 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 ?
> {code}
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to