commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COMPLEX-4) Complex.ZERO.pow(2.0) is NaN
Date Mon, 09 Jan 2017 02:59:58 GMT

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

ASF GitHub Bot commented on COMPLEX-4:
--------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/commons-complex/pull/3


> Complex.ZERO.pow(2.0) is NaN
> ----------------------------
>
>                 Key: COMPLEX-4
>                 URL: https://issues.apache.org/jira/browse/COMPLEX-4
>             Project: Commons Complex
>          Issue Type: Bug
>         Environment: Linux, Java1.7/Java1.8
>            Reporter: Raymond DeCampo
>            Priority: Minor
>
> Description copied from MATH-1397 as reported by Mario Wenzel:
> {quote}
> ```
> package complextest;
> import org.apache.commons.math3.complex.Complex;
> public class T \{
> public static void main(String[] args)
> \{ System.out.println(Complex.ZERO.pow(2.0)); }
> }
> ```
> This is the code and the readout is `(NaN, NaN)`. This surely isn't right. For one, it
should actually be zero (https://www.wolframalpha.com/input/?i=(0%2B0i)%5E2) and second of
all, the documentation doesn't state that anything could go wrong from a Complex number that
has no NaNs and Infs.
> The other definition states that it doesn't work when the base is Zero, but it surely
should. This strange corner case destroys any naive implementation of stuff wrt the mandelbrot
set.
> It would be nice to not have to implement this exception myself.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message