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 Tue, 19 Jul 2011 08:15:58 GMT

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

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

Fix for some typos:
{code}
    /**
     * Returns a {@code Complex} whose value is {@code (this +
     * augend)}.
     * <p>
     * Uses the definitional formula
     * <pre>
     * (a + bi) + (c + di) = (a+c) + (b+d)i
     * </pre></p>
     * <p>
     * If either <code>this</code> or <code>augend</code> has a <code>NaN</code>
value in either part,
     * {@link #NaN} is returned; otherwise <code>Infinite</code> and <code>NaN</code>
values are
     * returned in the parts of the result according to the rules for
     * {@link java.lang.Double} arithmetic.</p>
     *
     * @param  augend value to be added to this {@code Complex}.
     * @return {@code this + augend}
     * @throws NullArgumentException if <code>rhs</code> is null
     */
    @Override
    public Complex add(Complex augend)
        throws NullArgumentException {
        MathUtils.checkNotNull(augend);
        if (isNaN || augend.isNaN) {
            return NaN;
        }
        return createComplex(real + augend.getReal(),
            imaginary + augend.getImaginary());
    }
{code}

On can link Infinity and NaN to Double.*, but I think that is not necessary. 

> 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