From bug-request at octave dot org Tue Feb 7 13:19:07 2006 Subject: Re: empty string becomes empty array in comparison, tests fail From: Quentin Spencer To: "Tom Holroyd (NIH/NIMH) [E]" CC: bug at octave dot org Date: Tue, 07 Feb 2006 13:14:29 -0600 Tom Holroyd (NIH/NIMH) [E] wrote: > Hi. I'm porting a largish Matlab code (40,000 lines) and found this > using a very recent Octave CVS 2.9.4. > > This is OK: > > octave:22> line = ' '; > octave:23> line == 1 > ans = 0 > octave:24> line ~= 1 > ans = 1 > > I suggest that the behavior below is wrong, and should be like the above. > > octave:25> line = ''; > octave:26> line ~= 1 > ans = [](0x0) > octave:27> line == 1 > ans = [](0x0) This is exactly what Matlab does, so as long as "compatible"=="correct", then this is "correct". -Quentin ------------------------------------------------------------- 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 -------------------------------------------------------------