Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert hexadecimal to decimal numbers in calc of Emacs?

Tags:

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?

like image 387
1.618 Avatar asked Dec 07 '09 12:12

1.618


Video Answer


2 Answers

You can enter any number in the format <base>#<number>. Example: 16#FF is immediately converted to 255.

For the reverse, you need to set the output display mode. In this example, d r 16 RET sets the display to base 16. Set it to base 10 to get the default behaviour again.

By the way, you can also Read The Fine ManualTM: GNU Emacs Calc Manual.

like image 84
Svante Avatar answered Oct 15 '22 08:10

Svante


Svante answered your question, but I'd like to add that the Radix Display Mode change has a quicker keystroke:

  • Show in hexidecimal mode: d 6
  • Show in decimal mode: d 0
like image 44
piyo Avatar answered Oct 15 '22 09:10

piyo