[ https://issues.apache.org/jira/browse/MATH1414?page=com.atlassian.jira.plugin.system.issuetabpanels:commenttabpanel&focusedCommentId=15980208#comment15980208
]
Bruno P. Kinoshita commented on MATH1414:

>It might be better for traceability to leave it open until the whole package is deleted.
Works for me :)
>But if it's clear enough right now that followup happens in "Commons Numbers", no problem.
Yup, I'm still watching this issue, but will focus the work on NUMBERS22 now.
Thanks Gilles
> Method reciprocal() in Complex for complex numbers with parts very close to 0.0
> 
>
> Key: MATH1414
> URL: https://issues.apache.org/jira/browse/MATH1414
> Project: Commons Math
> Issue Type: Improvement
> Reporter: Gunel Jahangirova
> Priority: Minor
> Fix For: 4.0
>
>
> In class Complex method reciprocal() returns INF only if the real and imaginary parts
are exactly equal to 0.0. In the cases when real and imaginary parts are double numbers very
close to 0.0, it does not hold. For example, if we run this code
> {code}
> Complex complex0 = new Complex((2.44242319E315));
> Complex complex1 = complex0.reciprocal();
> {code}
> the value of complex1.getReal() will be Infinity and the value of complex1.getImaginary()
will be NaN, instead of complex1 being equal to INF.
> I think the code in the method
> {code}
> if (real == 0.0 && imaginary == 0.0) {
> return INF;
> }
> {code}
> should be replaced by the equality check with some tolerance (0.01 in this case):
> {code}
> if (equals(this, ZERO, 0.01)) {
> return INF;
> }
> {code}

This message was sent by Atlassian JIRA
(v6.3.15#6346)
