Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Numerical Evaluation & Precision > Display of Numbers > BaseForm >

BaseForm

BaseForm
prints with the numbers in expr given in base n.
  • The maximum allowed base is 36. For bases larger than 10, additional digits are chosen from the letters -. »
  • You can enter a number in an arbitrary base using . »
  • When a number in an arbitrary base is given in scientific notation, the exponent is still given in base 10. »
  • BaseForm acts as a "wrapper", which affects printing, but not evaluation.
A binary integer:
A binary real:
Represent single-digit hexadecimal numbers:
A binary integer:
In[1]:=
Click for copyable input
Out[1]//BaseForm=
A binary real:
In[2]:=
Click for copyable input
Out[2]//BaseForm=
 
Represent single-digit hexadecimal numbers:
In[1]:=
Click for copyable input
Out[1]//BaseForm=
Represent a random number in bases 2 through 36:
A complex number formatted in base 3:
An arbitrary-precision number in base 5:
A vector of reals in base 8:
A matrix:
A mixed symbolic and numeric expression with numbers represented in base 12:
Exponents are given in base 10:
Input a number in base 16:
Output in base 16:
BaseForm formats numbers in a given base:
IntegerDigits gives a list of the digits:
Convert back to base 10:
IntegerString gives the digits as a string:
Convert the string back to a base-10 number:
Format a real number in base 2:
RealDigits gives a list of the digits and number of digits to the left of the decimal:
Reconstruct the base-10 number from RealDigits output:
Convert a number to base 2:
Represent the number to be precise to 3 decimal digits using NumberForm:
The base must be an integer between 2 and 36:
Expansions in different bases can be terminating or non-terminating for the same number:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF