octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39608] hex2num: parse single-precision hex st


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #39608] hex2num: parse single-precision hex strings
Date: Mon, 29 Jul 2013 18:50:49 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20100101 Firefox/17.0

Update of bug #39608 (project octave):

                Severity:              3 - Normal => 1 - Wish               
              Item Group:    Matlab Compatibility => Feature Request        
                  Status:                    None => Need Info              
                 Release:                   3.6.4 => dev                    
        Operating System:       Microsoft Windows => Any                    
                 Summary: hex2num improvement respect to matlab => hex2num:
parse single-precision hex strings

    _______________________________________________________

Follow-up Comment #1:

The problem with this change is that it's not a Matlab compatibility request,
it would break Matlab compability. hex2num already has a well-defined behavior
if the input string contains fewer than 16 characters, it is padded on the
right with zeros. So it can't differentiate between double and single
precision given only a string.

We could, however, add a second optional argument for the class to return,
like eps() and zeros() do, which would be non-Matlab-compatible. So for
example something like this:


octave:1> hex2num ("3ff0000000000000")
ans =  1
octave:2> hex2num ("3f800000")
ans =  0.0078125
octave:3> hex2num ("3f800000", "single")
ans =  1


Would that address your request?

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39608>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]