From bug-octave-request at bevo dot che dot wisc dot edu Tue Dec 10 13:44:34 2002 Subject: RE: 0*NaN within matrix multiplication From: "Lippert, Ross A." To: "Paul Kienzle" Cc: "Schloegl Alois" , Date: Tue, 10 Dec 2002 14:44:25 -0500 Ahh. In that case the bug is smaller (and cuter): octave:17> [nan]*[0] ans = NaN octave:18> [nan nan]*[0;0] ans = 0 Yes, I agree that the above is a bad thing(tm). -r -----Original Message----- From: Paul Kienzle [mailto:pkienzle at jazz dot ncnr dot nist dot gov] Sent: Tuesday, December 10, 2002 2:27 PM To: Lippert, Ross A. Cc: Schloegl Alois; bug-octave at bevo dot che dot wisc dot edu Subject: Re: 0*NaN within matrix multiplication 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 -------------------------------------------------------------