bugGNU Octave - Bugs: bug #53427, "format compact" gets...

 
 

bug #53427: "format compact" gets reset whenever precision format options are set

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Thu 22 Mar 2018 07:11:50 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 04 Apr 2018 05:38:18 PM UTC, comment #3: 

Thanks for this fix.
(although it was a minor annoyance)

Philip Nienhuis <philipnienhuis>
Group Member
Wed 04 Apr 2018 05:13:10 AM UTC, comment #2: 

I fixed this on the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/13cd142c3f88).

Rik <rik5>
Group administrator
Thu 22 Mar 2018 08:56:25 PM UTC, comment #1: 

Confirmed.  And it is stranger than average.  If I request an output argument, then 'compact' is remembered.


octave:18> format compact short
octave:19> x = magic (3)
x =
   8   1   6
   3   5   7
   4   9   2

octave:20> [~] = format ("long")
octave:21> x
x =
   8   1   6
   3   5   7
   4   9   2

octave:22> format long
octave:23> x
x =

   8   1   6
   3   5   7
   4   9   2




Rik <rik5>
Group administrator
Thu 22 Mar 2018 07:11:50 PM UTC, original submission:  

(This is a long standing bug, dating back to 3.6.4 o earlier)

format compact should be independent of other format settings relating to e.g.,precision of output format.
I find that format compact is consistently reset whenever e.g., "format long" or "format bank" is set.
IMO format compact or format loose settings shouldn't be rest by precision format settings.


>> a.f = 2
a =

  scalar structure containing the fields:

    f =  2

>> a.g = 3
a =

  scalar structure containing the fields:

    f =  2
    g =  3

>> a
a =

  scalar structure containing the fields:

    f =  2
    g =  3

>> format compact
>> a
a =
  scalar structure containing the fields:
    f =  2
    g =  3

>> format long
>> a
a =

  scalar structure containing the fields:

    f =  2
    g =  3



Matlab does it right:

>> format compact
>> a.f = 2
a =
  struct with fields:

    f: 2
>> a.g = 3
a =
  struct with fields:

    f: 2
    g: 3
>> a
a =
  struct with fields:

    f: 2
    g: 3
>> format long
>> a
a =
  struct with fields:

    f: 2
    g: 3
>> format loose
>> a

a =

  struct with fields:

    f: 2
    g: 3

>>


Philip Nienhuis <philipnienhuis>
Group Member

 

(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 philipnienhuis (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-04-04 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-03-22 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code