commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-577) Enhance Complex.java
Date Wed, 13 Jul 2011 21:21:59 GMT

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

Gilles commented on MATH-577:
-----------------------------

I think that "equals" for "Complex" is indeed buggy (or inconsistent with "double"):

{code}
final double a = Double.NaN;
final double b = Double.NaN;
Assert.assertFalse("a == b", a == b); // <-- Passes
final Complex cA = new Complex(a, 0);
final Complex cB = new Complex(b, 0);
Assert.assertFalse("cA == cB", cA.equals(cB)); // <-- Fails
{code}

Also, shouldn't any {{double}} number "a" (except Double.NaN) be considered equal to the object
created with "new Complex(a, 0)"?


> Enhance Complex.java
> --------------------
>
>                 Key: MATH-577
>                 URL: https://issues.apache.org/jira/browse/MATH-577
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Arne Plöse
>            Priority: Minor
>         Attachments: Complex.diff, Complex.diff
>
>
> Add some double shorthand methods to Complex fix different NaN checks in add and subtract
! Testcase  testAddNaN will fail (what should be the result ?)
> What is missing JavaDoc and testcases.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message