ka1gt
2018-11-15 19:05:11 UTC
For reasons I won't go into (another application), I need to convert a
decimal number into a hexadecimal number - but not in the usual way.
As an example I need to convert the integer "*14*" into the hexadecimal
number "0x*14*"
Is there a simple way to do this? I thought of number -> string -> number,
but there's no string to hex conversion as far as I can see.
I could do it by taking the integer "14", splitting it up into 1 and 4,
taking (1*16)+(4) = 20 and then converting 20 to a hex number which gives me
"0x14", but is there a simpler way to do this that I'm missing?
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
decimal number into a hexadecimal number - but not in the usual way.
As an example I need to convert the integer "*14*" into the hexadecimal
number "0x*14*"
Is there a simple way to do this? I thought of number -> string -> number,
but there's no string to hex conversion as far as I can see.
I could do it by taking the integer "14", splitting it up into 1 and 4,
taking (1*16)+(4) = 20 and then converting 20 to a hex number which gives me
"0x14", but is there a simpler way to do this that I'm missing?
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html