Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Convert Base in Mathematica

  1. Mar 31, 2005 #1

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    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?
     
  2. jcsd
  3. Mar 31, 2005 #2

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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
     
  4. Mar 31, 2005 #3

    Zurtex

    User Avatar
    Science Advisor
    Homework Helper

    Uber thanks, couldn't make sense of the help files.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Convert Base in Mathematica
  1. In mathematica (Replies: 4)

  2. Mathematica Sums (Replies: 6)

  3. Mathematica NDSolve (Replies: 27)

Loading...