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

Arturo Bernal commented on LANG-1541:
-------------------------------------

Hi [~ggregory]

 

PR created.

 

Kind Regards 

> 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
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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