commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Plöse (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MATH-577) Enhance Complex.java
Date Mon, 18 Jul 2011 14:03:58 GMT

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

Arne Plöse commented on MATH-577:
---------------------------------

Maybe this way?:

{code}
    /**
     * Return the sum of this complex number and the given scalar number.
     * This is a shorthand for pure real value rsh of {@link #add(org.apache.commons.math.complex.Complex)}
     * 
     * @param rhs the scalar number
     * @return the complex number sum
     * @see #add(org.apache.commons.math.complex.Complex)
     */
    public Complex add(double rhs) {
        if (isNaN || Double.isNaN(rhs)) {
            return NaN;
        }
        return createComplex(real + rhs, imaginary);
    }
{code}

I want to make it clear that you can expect the same behaviour as of () in this case {code}add(new
Complex(rsh, 0);{code}

> 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, 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