Multiplication of complex conjugate numbers wrong in Octave 3.0.5 mingw32

FélixB felix.buehlmann at acousticimplants.com
Sat May 23 09:54:19 CDT 2009




Benjamin Lindner wrote:
> 
> FélixB wrote:
>> Hello,
>> 
>> I get an error when multiplying complex conjugate numbers (see example
>> below). The diagonal of the matrix should be real. I have not this error
>> with version 3.0.3 (MSVC).
>> 
>> octave:5> a = rand(10000,2)+j*rand(10000,2);
>> octave:6> imag(diag(a'*a))
>> ans =
>> 
>>   -2.6396e-014
>>   -2.2185e-014
>> 
>> Félix
>> 
> 
> Octave is not a symbolic math tool, it's a numerical math tool.
> Thus it uses floating-point arithmetic.
> Floating-point arithmetic shows roundoff errors like the ones you 
> describe here, it's inherent.
> So it's not an error, this is floating point arithmetic.
> 
> benjamin
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave
> 
> 
Thank's Benjamin for your answer, but I think there is a bug. As said
before, I get the correct answer in version 3.0.3 (i.e no imaginary part).
See please the example below which give the correct answer with a matrix of
10000x1, but a different result when duplicated in a 10000x2 matrix .
 
I never seen such an error in previous version.

Thank's for you help.

octave:15> a=rand(10000,1)+j*rand(10000,1);
octave:16> imag(a'*a)
ans = 0
octave:17> b=[a,a];
octave:18> imag(b'*b)
ans =

  -2.4536e-014  -2.4536e-014
  -2.4536e-014  -2.4536e-014
-- 
View this message in context: http://www.nabble.com/Multiplication-of-complex-conjugate-numbers-wrong-in-Octave-3.0.5-mingw32-tp23684142p23685232.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.




More information about the Bug-octave mailing list