PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Mathematics and Algorithms
>
Numerical Evaluation & Precision
>
Display of Numbers
>
BaseForm
>
BUILT-IN MATHEMATICA SYMBOL
Output Formats for Numbers
Digits in Numbers
Tutorials »
|
IntegerDigits
IntegerString
RealDigits
NumberForm
See Also »
|
Display of Numbers
Number Digits
More About »
BaseForm
BaseForm
prints with the numbers in
expr
given in base
n
.
MORE INFORMATION
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.
»
You can mix
BaseForm
with
NumberForm
and related functions.
»
BaseForm
acts as a "wrapper", which affects printing, but not evaluation.
EXAMPLES
CLOSE ALL
Basic Examples
(2)
A binary integer:
A binary real:
Represent single-digit hexadecimal numbers:
A binary integer:
In[1]:=
Out[1]//BaseForm=
A binary real:
In[2]:=
Out[2]//BaseForm=
Represent single-digit hexadecimal numbers:
In[1]:=
Out[1]//BaseForm=
Scope
(5)
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:
Properties & Relations
(5)
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
:
PaddedForm
:
EngineeringForm
:
ScientificForm
:
AccountingForm
:
Possible Issues
(1)
The base must be an integer between 2 and 36:
Neat Examples
(1)
Expansions in different bases can be terminating or non-terminating for the same number:
SEE ALSO
IntegerDigits
IntegerString
RealDigits
NumberForm
TUTORIALS
Output Formats for Numbers
Digits in Numbers
MORE ABOUT
Display of Numbers
Number Digits
New in 1