Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Services & Resources / Archive
-----
 /
Mathematica
*Mathematica
*Network Mathematica
*webMathematica
*gridMathematica
*Personal Grid Edition
*Wolfram Workbench
*Wolfram Education Group
*Application Packages
*Mathematica for Students
*Mathematica CalcCenter
*Publicon
*A New Kind of Science Explorer
*Mathematical Explorer
*Mathematica Teacher's Edition
*Calculus WIZ
*Mathematica Player
*Ask about this page
*Print this page
*Email this page
*Give us feedback
*
Sign up for our newsletter:

How does Mathematica 4.0 change N in the display of machine numbers?

In Mathematica 3.0 and earlier, the second argument in N controlled not only the precision of the calculation, but also the number of digits to display for machine number results. This effect of N on the display was undocumented and has been removed for subsequent versions of Mathematica. Machine numbers will instead be displayed in such examples with a default precision.

The recommended approach for controlling the number of digits in the display in all versions of Mathematica is to use functions such as NumberForm that are designed and documented for that purpose.

In Mathematica after Version 3, the default precision for the display of machine numbers can also be changed using the MachineRealPrintPrecision system option for numbers displayed in OutputForm, and using the PrintPrecision option in the Option Inspector for numbers displayed in StandardForm or TraditionalForm.

The mathematical characteristics of results from N are unchanged. This change also has no effect on results that are not machine numbers. The only change is in the display, and the change only applies to machine numbers.

Here is an example showing typical behavior in Version 3 and earlier.

In[1]:=
Out[1]=
 

 

Here is the same example for Mathematica 3.0 and later, showing a machine number result displayed with the default printing precision.

In[1]:=
Out[1]=
 

 

A related change is that the number of input digits for machine numbers is also not preserved for the purpose of display. Here is an example showing preservation of the number of input digits in Version 3.

In[2]:=
Out[2]=
 

 

Here is the same example for later versions of Mathematica, showing the machine number displayed with the default printing precision.

In[2]:=
Out[2]=
 

 

The change was made because this feature required additional memory for every number and because it could not be implemented consistently. The display of a number would be different, for example, depending on whether a number was the direct result of N, or the number originated with some other calculation.

Here is an example showing the use of NumberForm to control the number of digits in the display.

In[3]:=
Out[3]//NumberForm=
 

 

The default number of digits for displaying machine numbers in OutputForm can be controlled using the system option MachineRealPrintPrecision.

In[4]:=
Out[4]=
 

 
In[5]:=
Out[5]=
 

 

Download this FAQ as a Mathematica 5.2 Notebook






 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy | [ja]