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-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org