Complex array converted into real when all numebers are 0+0i

Jaroslav Hajek highegg at gmail.com
Sat Jul 25 09:26:19 CDT 2009


On Fri, Jul 24, 2009 at 1:50 PM, John W. Eaton<jwe at octave.org> wrote:
> On 24-Jul-2009, nicolas wrote:
>
> | Bug report for Octave 3.2.2 configured for i686-pc-linux-gnu
> |
> | Description:
> | -----------
> |
> |   * Array containing complex numbers equal to 0 + 0i are converted into real
> |
> | Repeat-By:
> | ---------
> |
> |   * Normal behaviour
> |     octave:1> complex(0,0)
> |     ans =  0 + 0i
> |
> |     Converted into real
> |     octave:2> [complex(0,0)]
> |     ans = 0
> |
> |     When a complex different of 0+0i is in the array, ok
> |     octave:3> [complex(0,0), complex(0,1)]
> |     ans =
> |        0 + 0i   0 + 1i
> |
> |     When all numbers are 0+0i converted again to real
> |     octave:4> [complex(0,0), complex(0,0)]
> |     ans =
> |        0   0
> |
> |     Explicit is working
> |     octave:5> complex([complex(0,0), complex(0,0)])
> |     ans =
> |        0 + 0i   0 + 0i
>
> I checked in the following change.
>
>  http://hg.savannah.gnu.org/hgweb/octave/rev/1fddcf651559
>
> Jaroslav, maybe this would be OK for future 3.2.x releases?
>

I transplanted it to 3.2.x.

cheers

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



More information about the Bug-octave mailing list