How can I convert hexadecimal to decimal numbers in Emacs calc?
For example, if I enter FF, I want it to convert it to 255.
UPDATE: How do I get the reverse operation, turn base 10 to base 16?
How can I convert hexadecimal to decimal numbers in Emacs calc?
For example, if I enter FF, I want it to convert it to 255.
UPDATE: How do I get the reverse operation, turn base 10 to base 16?
Svante answered your question, but I'd like to add that the Radix Display Mode change has a quicker keystroke:
d 6d 0Of course you could type 16#FF to enter 0xFF, but there is a more convenient way.
The other option:
d 6# like #FF and <enter>. (The # means interpret number with given display radix)d 0.Note: A number entered without # always inserts a decimal number.
Note2: This also works the other way round.
Negative Values: Now lets say you have a 8-bit system and you want to know how decimal -3 is stored in this systems RAM.
b w 83 n and <enter>O d 6. (The O as Option is important to enable two's complement.)Note: you see 16##FD. Two # means it is signed and the value stored in RAM is 0xFD
The above stuff works also with d 2, d 8 (as shortcuts for bin and oct) and other possible display radixes from 2 to 36 (d r <radix-number>).
This info is taken from the Emacs Calc Manual.