bugGNU Octave - Bugs: bug #42343, textscan: difference between NaN...

 
 

bug #42343: textscan: difference between NaN and empty values

Submitted by:  sergey plotnikov <nul0m>
Submitted on:  Tue 13 May 2014 08:05:35 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Philip Nienhuis <philipnienhuis>
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 04 Jun 2014 03:11:55 PM UTC, comment #4:

I applied your changeset to the development branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/8354510f95ab). The sample code in this bug report seems to work correctly now. Closing report.

Rik <rik5>
Project Administrator
Fri 16 May 2014 09:18:20 AM UTC, comment #3:

[OT: Found out that my Mercurial version (2.1.1) is too old for @ bookmarks :-( Will be fixed only when I upgrade my Linux distro, one of these days.]

Anyway this wasn't a matter of ML compatibility but a plain bug: textscan.m would redo the emptyvalue work done by strread.m (its workhorse) assuming strread.m returns NaN for empty fields. However strread.m does it right (the example works fine with just strread).
I think that's why this bug was concealed for so long: it was triggered only when hitting original NaN input fields.

Another bug was that textscan.m ignored user-specified emptyvalue when padding output data for incomplete last lines of input files (also fixed now).

So, in case of user-specified emptyvalue, I expect textscan.m to work a tiny bit faster now :-)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Thu 15 May 2014 10:23:20 AM UTC, comment #2:

Here's a cs with another -more to the point- test

(file #31379)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Tue 13 May 2014 08:13:11 PM UTC, comment #1:

Thx for reporting.

Changeset attached.

@devs: how do I push with advancing the @ bookmark?
just "hg push @" ?

(file #31371)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Tue 13 May 2014 08:05:35 AM UTC, original submission:

There's a nuance in Matlab's behavior of textscan() -- NaNs which were found in a text are not treated as empty values but as NaNs literally.

These may cause different result comparing to ML's one. See below.

Matlab

Octave

sergey plotnikov <nul0m>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31379:  textscan_42343.cs2 added by philipnienhuis (2KiB - image/x-kde-raw)
file #31371:  textscan_42343.cs added by philipnienhuis (1KiB - text/x-csharp)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by nul0m (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 04 Jun 2014 03:11:55 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Fri 16 May 2014 09:18:20 AM UTCphilipnienhuisItem GroupMatlab Compatibility=>Incorrect Result
      Operating SystemGNU/Linux=>Any
    Thu 15 May 2014 10:23:20 AM UTCphilipnienhuisAttached File-=>Added textscan_42343.cs2, #31379
    Tue 13 May 2014 08:13:11 PM UTCphilipnienhuisAttached File-=>Added textscan_42343.cs, #31371
      StatusNone=>Ready For Test
      Assigned toNone=>philipnienhuis

    Back to the top


    Powered by Savane 3.1-cleanup1