help-octave
[Top][All Lists]
Advanced

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

Decimal to Hexadecimal - But not in the way you think!


From: ka1gt
Subject: Decimal to Hexadecimal - But not in the way you think!
Date: Thu, 15 Nov 2018 13:05:11 -0600 (CST)

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



reply via email to

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