help-octave
[Top][All Lists]
Advanced

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

Re: dec2hex with int types


From: Jaroslav Hajek
Subject: Re: dec2hex with int types
Date: Fri, 20 Nov 2009 10:36:59 +0100



On Wed, Oct 14, 2009 at 6:46 PM, Schirmacher, Rolf <address@hidden> wrote:

Hello,

with octave 3.0.3 on windows, I get the following strange results:

octave.exe> hex2dec(dec2hex((1234)))
ans =  1234
octave.exe> hex2dec(dec2hex(single(1234)))
ans =  1234
octave.exe> hex2dec(dec2hex(double(1234)))
ans =  1234
octave.exe> hex2dec(dec2hex(int16(1234)))
ans =  1490
octave.exe> hex2dec(dec2hex(uint16(1234)))
ans =  1490
octave.exe> hex2dec(dec2hex(int32(1234)))
ans =  1490
octave.exe> hex2dec(dec2hex(uint32(1234)))
ans =  1490

As you might conclude from

octave.exe> dec2hex((1234))
ans = 4D2
octave.exe> dec2hex(uint32(1234))
ans = 5D2

the issue is with dec2hex, not with hex2dec.

Thanks in advance for any hint or help.

Rolf
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

I fixed this in the development sources.
http://hg.savannah.gnu.org/hgweb/octave/rev/edf065b51fa9

thanks

--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

reply via email to

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