octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50124] cplxpair produces incorrect result for


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #50124] cplxpair produces incorrect result for second column of complex pairs
Date: Mon, 23 Jan 2017 03:55:58 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #5, bug #50124 (project octave):

Matlab 2016b output:


>> format long
>> z = exp (2i*pi*[4; 3; 5; 2; 6; 1; 0]/7);
>> y = [ -1-1i; -1+1i;-3; -2; 1; 2; 3];
>> [z,y]
ans =
 -0.900968867902419 - 0.433883739117558i -1.000000000000000 -
1.000000000000000i
 -0.900968867902419 + 0.433883739117558i -1.000000000000000 +
1.000000000000000i
 -0.222520933956315 - 0.974927912181824i -3.000000000000000 +
0.000000000000000i
 -0.222520933956314 + 0.974927912181824i -2.000000000000000 +
0.000000000000000i
  0.623489801858733 - 0.781831482468030i  1.000000000000000 +
0.000000000000000i
  0.623489801858734 + 0.781831482468030i  2.000000000000000 +
0.000000000000000i
  1.000000000000000 + 0.000000000000000i  3.000000000000000 +
0.000000000000000i
>> cplxpair([z,y])
ans =
 -0.900968867902419 - 0.433883739117558i -1.000000000000000 -
1.000000000000000i
 -0.900968867902419 + 0.433883739117558i -1.000000000000000 +
1.000000000000000i
 -0.222520933956314 - 0.974927912181824i -3.000000000000000 +
0.000000000000000i
 -0.222520933956314 + 0.974927912181824i -2.000000000000000 +
0.000000000000000i
  0.623489801858734 - 0.781831482468030i  1.000000000000000 +
0.000000000000000i
  0.623489801858734 + 0.781831482468030i  2.000000000000000 +
0.000000000000000i
  1.000000000000000 + 0.000000000000000i  3.000000000000000 +
0.000000000000000i
>> cplxpair([z,y]) - [z,y]
ans =
   1.0e-15 *
  0.111022302462516 - 0.222044604925031i  0.000000000000000 +
0.000000000000000i
  0.000000000000000 + 0.000000000000000i  0.000000000000000 +
0.000000000000000i
  0.249800180540660 + 0.000000000000000i  0.000000000000000 +
0.000000000000000i
  0.000000000000000 + 0.000000000000000i  0.000000000000000 +
0.000000000000000i
  0.222044604925031 + 0.111022302462516i  0.000000000000000 +
0.000000000000000i
  0.000000000000000 + 0.000000000000000i  0.000000000000000 +
0.000000000000000i
  0.000000000000000 + 0.000000000000000i  0.000000000000000 +
0.000000000000000i


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50124>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]