[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: |
Mon, 22 Jan 2018 14:36:16 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0 |
Follow-up Comment #1, bug #52953 (project octave):
suggested BIST:
## reshaping nominally-complex values should not make them real
%!test <*52953>
%! assert (iscomplex (complex (0, 0)(:)))
%! assert (iscomplex (reshape (complex (0, 0), 1, 1)))
## reshaping should preserve signed zero
%!test <*52953>
%! z = complex ([0 0; -0 -0], [-0 0; -0 0]);
%! assert (signbit (real (z(:))), signbit (real (z))(:))
%! assert (signbit (imag (z(:))), signbit (imag (z))(:))
%! assert (signbit (real (reshape(z, 1, 4))), reshape (signbit (real (z)), 1,
4))
%! assert (signbit (imag (reshape(z, 1, 4))), reshape (signbit (imag (z)), 1,
4))
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52953>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/