bugGNU Octave - Bugs: bug #65000, dec2hex produces incorrectly...

 
 

bug #65000: dec2hex produces incorrectly formatted output for arrays of numbers less than 16

Submitter:  Charles Praplan <charprap>
Submitted:  Fri 08 Dec 2023 03:01:30 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Charles Praplan Open/Closed:  * Closed
Release:  * 8.4.0 Operating System:  * Any
Fixed Release:  9.1.0 (current stable) Planned Release:  9.1.0 (current stable)
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 09 Dec 2023 12:43:21 PM UTC, comment #2: 

I recall this one. It was fixed by the loop at the end of this: 
https://hg.savannah.gnu.org/hgweb/octave/rev/1f3f7e874203

and then slightly improved by this:
https://hg.savannah.gnu.org/hgweb/octave/rev/a098cc74d9a5

The topic of this bug report is covered in two BISTs near the end:


## Test that the output is of the correct size.
## Next line should return a column vector:
%!assert (dec2hex (0:15), "0123456789ABCDEF"(:))
## Next line should return a row vector:
%!assert (dec2hex (uint64 (18364758544493064720)), "FEDCBA9876543210")


The reason had been the matrix indexing rules as described in bug #63833.

Arun Giridhar <arungiridhar>
Group Member
Fri 08 Dec 2023 04:14:11 PM UTC, comment #1: 

This problem appears to already be fixed on stable.  That will be the next release, version 9.1.0.  Bisecting led me to this changeset as the one that fixed the problem, but I don't know exactly what it was in that change that fixed it.


octave:1> version
ans = 9.0.1
octave:2> dec2hex ([5, 9])
ans =

5
9


Marking as a regression and closing as fixed.

John W. Eaton <jwe>
Group administrator
Fri 08 Dec 2023 03:01:30 PM UTC, original submission:  

dec2hex function produces bad formatted output for vector inputs, if all output values have only one digit. This leads to wrong interpretation of the result as illustrated in the following example:

>> dec2hex([5, 9])
ans = 59


But in the next examples, the behavior is correct:

>> dec2hex([5, 9],2)
ans =

05
09

>> dec2hex([16, 9])
ans =

10
09


The problem is not new. It was already present in version 7.3.0 but not in version 6.4.0.
The problem is the same for line or column vectors.

Charles Praplan <charprap>

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-12-08 jwe Item GroupNone Regression
        StatusNone Fixed
        Open/ClosedOpen Closed
        Operating SystemMicrosoft Windows Any
        Fixed ReleaseNone 9.1.0 (current stable)
        Planned ReleaseNone 9.1.0 (current stable)
        Summarydec2hex problem dec2hex produces incorrectly formatted output for arrays of numbers less than 16

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code