[
https://issues.apache.org/jira/browse/MATH-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865171#action_12865171
]
Luc Maisonobe commented on MATH-370:
------------------------------------
I really think this is intentional and the fact that NaN != Nan was known to
the people who did that.
For example, the javadoc for Complex.equals
([http://commons.apache.org/math/apidocs/org/apache/commons/math/complex/Complex.html#equals%28java.lang.Object%29])
explicitly warns about behavior for NaN.
So on the one one changing this would break compatibility with respect to a
documented behavior and on the other hand it would bring compatibility with
IEEE arithmetic.
I'm sure there is a good reason for the current status, but I don't know it.
> NaN in "equals" methods
> -----------------------
>
> Key: MATH-370
> URL: https://issues.apache.org/jira/browse/MATH-370
> Project: Commons Math
> Issue Type: Bug
> Reporter: Gilles
> Priority: Minor
>
> In "MathUtils", some "equals" methods will return true if both argument are
> NaN.
> Unless I'm mistaken, this contradicts the IEEE standard.
> If nobody objects, I'm going to make the changes.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.