[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52953] reshaping "complex(0, 0)" should not m
From: |
Colin Macdonald |
Subject: |
[Octave-bug-tracker] [bug #52953] reshaping "complex(0, 0)" should not make it real |
Date: |
Tue, 23 Jan 2018 19:25:19 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0 |
Follow-up Comment #3, bug #52953 (project octave):
Thanks for the link.
I tried a bit more at work today:
Matlab 2014a:
>> x = complex(0,0)
x =
0 + 0i
>> x(:)
ans =
0 + 0i
>> reshape(x, 1, 1)
ans =
0 + 0i
Matlab 2015b
>> x = complex(0,0)
x =
0 + 0i
>> x(:)
ans =
0
>> reshape(x, 1, 1)
ans =
0 + 0i
So the behaviour of "x(:)" seems to have changed. This was on two different
computers, but both x64 I think.
I don't think Matlab allows "complex(0,0)(:)" so the intermediate variable is
the only way to test it.
I've always thought of "x(:)" as a short form of reshape, but it seems it is
not so.
I agree "reshape" should have the semantics of not changing the data type.
Whereas indexing operations could narrow (b/c users expect to pull a real
number out of a larger complex array for example).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52953>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/