commons-dev mailing list archives

Site index · List index
Message view
Top
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] Complex division WASRe [jira] [Commented] (MATH-657) Division by zero
Date Mon, 05 Sep 2011 14:21:36 GMT
On Mon, Sep 05, 2011 at 02:15:30PM +0200, Arne Ploese wrote:
> To make things clear here some octave (matlab as well) calculation with
> complex:
>
> octave:1> a = Inf + sqrt(-Inf)
> a = Inf + Infi
> octave:2> a * a
> ans = NaN + Infi
> octave:3> a = Inf + sqrt(-1)
> a = Inf +   1i
> octave:4> a * a
> ans = Inf + Infi
> octave:5> a = 1 + sqrt(-Inf)
> a =    1 + Infi
> octave:6> a * a
> ans = -Inf + Infi
> octave:7> a = 1 - sqrt(-Inf)
> a =    1 - Infi
> octave:8> a * a
> ans = -Inf - Infi
>
> Maybe Im wrong but I thought that was the result I could expect from
> commons math too.

It seems that the above outputs result from a direct application of the
computational formula (whereas.
As I suggested on JIRA, a complete set of comparisons, as a unit test, would
be most helpful to check where the discrepancies occur.

> In electrical engineering there is a difference if you have + or - 90
> degree phase shift, the tan will be +infinity or -infinity...
> If you math guys tell me that there is really no difference with complex
> numbers - I can live with it (Even if I dont understand why ;-)).

What would be really interesting is to know when the final result of the
DSP algorithm differ between Octave and the Java translation using CM.

Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org

Mime
View raw message