You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2011/07/13 22:24:01 UTC

[jira] [Created] (MATH-618) Complex Add and Subtract handle NaN arguments differently, but javadoc contracts are the same

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

        

[jira] [Resolved] (MATH-618) Complex Add and Subtract handle NaN arguments differently, but javadoc contracts are the same

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz resolved MATH-618.
------------------------------

    Resolution: Fixed

Fixed in r1146573

> 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: 1.2, 2.0, 2.1, 2.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