help-octave
[Top][All Lists]
Advanced

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

dec2hex with int types


From: Schirmacher, Rolf
Subject: dec2hex with int types
Date: Wed, 14 Oct 2009 19:46:44 +0200

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


reply via email to

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