bugGNU Octave - Bugs: bug #39860, Incorrect printf output.

 
 

bug #39860: Incorrect printf output.

Submitter:  None
Submitted:  Fri 23 Aug 2013 03:00:54 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Pierre Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 23 Aug 2013 06:35:31 PM UTC, comment #2: 

Check the documentation for printf.  It iterates over as many elements as are in the matrix.

Example:


x = [1 2 3];
printf ("%u\n", x)
1
2
3


In this case, argv is an empty matrix and size ([]) is [0 0], or a matrix of two elements, which printf properly displays.

Rik <rik5>
Group administrator
Fri 23 Aug 2013 04:36:44 PM UTC, comment #1: 

You might usefully notice the values
of argc.

The output is as expected.  No problem.

Michael Godfrey <godfrey>
Group Member
Fri 23 Aug 2013 03:00:54 PM UTC, original submission:  

This simple Octave script :

argc = size(argv());
printf('argc : %u\n', argc);

Produces :

argc : 0
argc : 0

(yes twice the expected output)

while if I do a simple printf('Hello World'); it produces the expected output only once.

Anonymous

 

(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 godfrey (Posted a comment)
  • -email is unavailable- added by None (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
    2013-08-23 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code