octave-maintainers
[Top][All Lists]
Advanced

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

imag () function detail regarding -0.0000


From: Daniel J Sebald
Subject: imag () function detail regarding -0.0000
Date: Tue, 11 Sep 2012 19:00:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

I was cleaning up fftfilt() wanting to zero out the real component of the final result and noticed -0 showing up unexpected to me. To achieve this I'm using something like y(:,xisimag) = imag(y(:,xisimag))*i, which to me is the most straightforward approach. The appearance of the -0's boils down to the following behavior of multiplication:

octave:59> [1,-1,-0]'*i
ans =

   0 + 1i
  -0 - 1i
  -0 - 0i

Is this proper behavior?  I would think

ans =

   0 + 1i
   0 - 1i
   0 - 0i

would be more appropriate in this case.

Dan


reply via email to

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