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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Sebb (Jira)
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

       
Reply | Threaded
Open this post in threaded view
|

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

Sebb (Jira)

     [ 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