From bug-octave-request at bevo dot che dot wisc dot edu Tue Dec 10 13:28:23 2002 Subject: Re: 0*NaN within matrix multiplication From: Paul Kienzle To: "Lippert, Ross A." Cc: Schloegl Alois , bug-octave@bevo.che.wisc.edu Date: Tue, 10 Dec 2002 14:27:20 -0500 0 * NaN and NaN * 0 should both be NaN regardless of the precision in the arithmetic. Is LAPACK doing some optimization so that it is not calculating the product when the first operand is zero? Paul Kienzle pkienzle at users dot sf dot net On Tue, Dec 10, 2002 at 02:10:15PM -0500, Lippert, Ross A. wrote: > > Why is this a bug? Since when did (y*B)' == B'*y' in inexact arithmetic? > > -r > > -----Original Message----- > From: Schloegl Alois [mailto:alois dot schloegl at tugraz dot at] > Sent: Tuesday, December 10, 2002 1:39 PM > To: bug-octave at bevo dot che dot wisc dot edu > Subject: 0*NaN within matrix multiplication > > > octave> x=[-2:2;4:8]'; > octave> y=x;y(2,1)=nan;y(4,2)=nan; > octave> B=[1,0,2;0,3,1]; > octave> > octave> (y*B)' > ans = > > -2 NaN 0 1 2 > 12 15 18 NaN 24 > 0 NaN 6 NaN 12 > > octave> B'*y' > ans = > > -2 NaN 0 NaN 2 > 12 NaN 18 NaN 24 > 0 NaN 6 NaN 12 > > > The same behaviour is observed in 2.1.40 > Is this a bug or an undocumented feature? > > A. > > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------