commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MATH-618) Complex Add and Subtract handle NaN arguments differently, but javadoc contracts are the same
Date Wed, 13 Jul 2011 20:24:01 GMT
Complex Add and Subtract handle NaN arguments differently, but javadoc contracts are the same
---------------------------------------------------------------------------------------------

                 Key: MATH-618
                 URL: https://issues.apache.org/jira/browse/MATH-618
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 2.2, 2.1, 2.0, 1.2
            Reporter: Phil Steitz
             Fix For: 3.0


For both Complex add and subtract, the javadoc states that

{code}
     * If either this or <code>rhs</code> has a NaN value in either part,
     * {@link #NaN} is returned; otherwise Inifinite and NaN values are
     * returned in the parts of the result according to the rules for
     * {@link java.lang.Double} arithmetic
{code}

Subtract includes an isNaN test and returns Complex.NaN if either complex argument isNaN;
but add omits this test.  The test should be added to the add implementation (actually restored,
since this looks like a code merge problem going back to 1.1).


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

        

Mime
View raw message