bugGNU Octave - Bugs: bug #54385, NaN and Inf printed instead of nan...

 
 

bug #54385: NaN and Inf printed instead of nan and inf

Submitter:  John W. Eaton <jwe>
Submitted:  Thu 26 Jul 2018 01:10:45 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Solaris/SunOS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 27 Jul 2018 08:55:27 PM UTC, comment #3: 

Yes, your fix is fine.  Thanks.

John W. Eaton <jwe>
Group administrator
Fri 27 Jul 2018 07:23:51 PM UTC, comment #2: 

@jwe: Okay to close this now?

Rik <rik5>
Group administrator
Thu 26 Jul 2018 07:09:13 PM UTC, comment #1: 

The difference is in the C++ iostream implementation.  It's complicated to follow, but eventuall the octave code is using


 << idx


If that value is NaN it gets formatted however the iostream library thinks it should be.  Since case sensitivity isn't important in this warning message I see no reason to try and make this consistent across operating systems.

I pushed a change to the stable branch which changes the BIST tests so they are case insensitive.  See https://hg.savannah.gnu.org/hgweb/octave/rev/61f8d94f6bbb.

Marking as Ready for Test.

Rik <rik5>
Group administrator
Thu 26 Jul 2018 01:10:45 PM UTC, original submission:  

Running the test suite on Solaris showed the following errors:


>>>>> processing index.tst
***** error <index \(nan,_\): subscripts>                 1(NaN,1)
!!!!! error failed.
Expected <index \(nan,_\): subscripts>, but got <index (NaN,_): subscripts must be either integers 1 to (2^31)-1 or logicals>

***** error <abc\(nan\): subscripts>         abc(NA)
!!!!! error failed.
Expected <abc\(nan\): subscripts>, but got <abc(NaN): subscripts must be either integers 1 to (2^31)-1 or logicals>

***** error <abc\(_,_,_,inf,_\): subscripts> abc(1,1,1,Inf,1)
 ##  Test sparse matrices
!!!!! error failed.
Expected <abc\(_,_,_,inf,_\): subscripts>, but got <abc(_,_,_,Inf,_): subscripts must be either integers 1 to (2^31)-1 or logicals>


The errors appear to be correct except that "Inf" and "NaN" are displayed and the test is expecting "inf" and "nan".

Should we fix the tests, or fix Octave to always print Inf and NaN values a particular way?  The latter seems more difficult unless we can be sure that all printing of Inf and NaN values goes through Octave's I/O system and none are printed directly with a system library.

John W. Eaton <jwe>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-27 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-07-26 rik5 StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code