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 Mon, 18 Jul 2011 18:13:57 GMT

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

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

Maybe a combination of my version and yours...
I don't like "shorthand" since it might let users wonder whether a temporary Complex variable
is created.
The "@see" tag is fine.
I also wonder why the parameter is called "rhs".

So:
{code}
/**
 * Computes the sum of this complex number and the given scalar number.
 * 
 * @param c Number to add.
 * @return {@code this + c}.
 * @see #add(Complex)
 */
public Complex add(double rhs) {
    if (isNaN || Double.isNaN(rhs)) {
      return NaN;
    }
    return createComplex(real + rhs, imaginary);
}
{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