PDA

View Full Version : Convert Base in Mathematica


Zurtex
Mar31-05, 12:47 PM
I've never really used Mathematica before so I'm rather confused by it, how would I say convert a number, 23a94b13 to base 10?

chroot
Mar31-05, 12:57 PM
To enter a number of an arbitrary base, use the syntax:

base^^digits

For example, to enter the hexadecimal number 1AD, use the notation 16^^1AD.

To print a number out in an arbitrary base (Mathematica normally uses decimal), use the BaseForm[number, base] function.

For example, to print that same number in binary, use BaseForm[16^^1AD, 2].

NB: Mathematica has very good built-in searchable help. Always start by checking the help files.

- Warren

Zurtex
Mar31-05, 01:02 PM
Uber thanks, couldn't make sense of the help files.