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

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

[Octave-bug-tracker] [bug #45387] Matrix product treats NaN times zero a


From: Rik
Subject: [Octave-bug-tracker] [bug #45387] Matrix product treats NaN times zero as zero
Date: Wed, 24 Jun 2015 04:51:45 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0

Update of bug #45387 (project octave):

                  Status:                    None => Confirmed              
                 Summary: Matrix Product treats NaN times zero as zero =>
Matrix product treats NaN times zero as zero

    _______________________________________________________

Follow-up Comment #1:

Confirmed.

There is some sort of inconsistency because a scalar by scalar multiplication


NaN * 0
ans = NaN


and vector by vector multiplication works as you have demonstrated.  Also,
matrix by matrix multiplication yields NaNs in the correct places too.


x2 * x2
ans =

   NaN   NaN
   NaN     3


It seems that only matrix by vector multiplication is inconsistent.  And that
has something to do with the element being *exactly* 0 as you have noticed. 
Shifting the 0 to eps gives the correct answer


y2 = [eps; 1];
x2 * y2
ans =

      NaN
   1.0000


In fact, its even stranger than that as vector by matrix works.


y' * x2
ans =

   NaN     1




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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