bugGNU Octave - Bugs: bug #53169, format free displays 1 more digit...

 
 

bug #53169: format free displays 1 more digit than short format

Submitter:  Rik <rik5>
Submitted:  Fri 16 Feb 2018 01:28:06 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 16 Feb 2018 04:44:41 PM UTC, comment #3: 

I checked in a changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/d277debe9c2f) that more fully documents the "free", "+", and "bank" formats.

Marking bug as fixed and closing report.

Rik <rik5>
Group administrator
Fri 16 Feb 2018 05:24:59 AM UTC, comment #2: 

I'm not sure it is a super useful format, but I don't mind keeping it around.  I think just documenting it would be enough.

Rik <rik5>
Group administrator
Fri 16 Feb 2018 05:07:51 AM UTC, comment #1: 

Format free is supposed to be what you would get using the simplest output from C++ using "std::cout << d" with default settings or Fortran's print *, d (free format).

Maybe it's not that useful and could be deprecated.  But I don't know that anything needs to be fixed with the format itself if we decide to keep it.  Maybe explain it better?

John W. Eaton <jwe>
Group administrator
Fri 16 Feb 2018 01:28:06 AM UTC, original submission:  

The free format seems to be a modifier, like "loose" or "compact", rather than a truly independent format.  However, it messes with the displayed number of significant figures.

Example 1:


octave:1> format short
octave:2> x = [pi;-1;e]
x =

   3.1416
  -1.0000
   2.7183

octave:3> format free
octave:4> x
x =

 3.14159
 -1
 2.71828


octave:5>


Example 2:


octave:1> format long
octave:2> x = [pi;-1;e]
x =

   3.14159265358979
  -1.00000000000000
   2.71828182845905

octave:3> format free
octave:4> x
x =

 3.14159
 -1
 2.71828




Example 3:


x = [1.2;1;-pi]
x =

 1.2
 1
 -3.14159


Of course, it is possible that I misunderstand the format and that it is supposed to use the minimum number of significant figures necessary, but no more than 6 significant digits, and not to align decimal points.

Rik <rik5>
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 jwe (Posted a comment)
  • -email is unavailable- added by rik5 (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-02-16 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code