bugGNU Octave - Bugs: bug #62430, 'format' function accept state...

 
 

bug #62430: 'format' function accept state 'default'

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Mon 09 May 2022 04:35:28 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 May 2022 07:34:53 PM UTC, comment #2: 

I reviewed your patch and checked in the patch here: https://hg.savannah.gnu.org/hgweb/octave/rev/4ef25c610433.

A few comments, it did not work as coded.  You had remarked that it was an untested patch, but I think it would be a good idea to try a quick compile and test on the command line to verify before submitting.  One of the amendments I did first was to add a BIST test to the changeset and only when that failed did I discover that the code wasn't working.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Mon 09 May 2022 06:07:02 PM UTC, comment #1: 

the following patch (untested) should add a 'default' option to format that behaves the same as format called with on options.  it also updates the help text with information about that option, adds the missing function form specifier, and adds a note that calling with both inputs and outputs produces an error.

(file #53184)

Nicholas Jankowski <nrjank>
Group Member
Mon 09 May 2022 04:35:28 PM UTC, original submission:  

In v 2021a, Matlab's format command accepts a format specifyer 'default' which is the equivalent to calling 'format' without any input specifiers to restore the default state. 


R2021a: format with no arguments is not recommended
Not recommended starting in R2021a

The format command, by itself, resets the output display format to the default, which is the short, fixed-decimal format for floating-point notation and loose line spacing for all output lines.

format
For clearer code, explicitly specify the default style (since R2021a).

format default


for compatability, we should probably support this option as well.

Nicholas Jankowski <nrjank>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #53184:  format_adddefault_bug62430.diff added by nrjank (3KiB - application/octet-stream)

 

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 nrjank (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
    2022-05-10 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2022-05-09 nrjank Attached File- Added format_adddefault_bug62430.diff, #53184

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code